/** * Re-throws the original throwable if it is unchecked, wraps checked * exceptions into {@link RepeatException}. */ private static void rethrow(Throwable throwable) throws RuntimeException { if (throwable instanceof Error) { throw (Error) throwable; } else if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else { throw new RepeatException("Exception in batch process", throwable); } }
throw e.getCause();
throw e.getCause();
assertSame(exception, expected.getCause());
@Override public RepeatStatus doInIteration(RepeatContext context) throws Exception { throw new RepeatException("typically thrown by nested repeat template", exception); } });
/** * Tell the queue to expect a result. */ public void expect() { try { queue.expect(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RepeatException("InterruptedException waiting for to acquire lock on input."); } }
throw e.getCause();
@Override public Exception getException(String msg) throws Exception { return new RepeatException(msg); }
logger.debug("Job execution complete: " + execution); } catch (RepeatException e) { throw e.getCause();
@Override public Exception getException(String msg, Throwable t) throws Exception { return new RepeatException(msg, t); }
@Override public RepeatStatus iterate(RepeatCallback callback) { try { Object result = callback.doInIteration(null); calls.add(result); } catch (Exception e) { throw new RepeatException("Encountered exception in repeat.", e); } return RepeatStatus.CONTINUABLE; } });
throw new RepeatException("InterruptedException while waiting for result.");
throw e.getCause();
/** * Re-throws the original throwable if it is unchecked, wraps checked * exceptions into {@link RepeatException}. */ private static void rethrow(Throwable throwable) throws RuntimeException { if (throwable instanceof Error) { throw (Error) throwable; } else if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else { throw new RepeatException("Exception in batch process", throwable); } }
throw e.getCause();
/** * Tell the queue to expect a result. */ public void expect() { try { queue.expect(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RepeatException("InterruptedException waiting for to acquire lock on input."); } }