IN PROGRESS - issue BATCH-491: checked exception handling
http://jira.springframework.org/browse/BATCH-491 exception handler signature changed to 'throws Throwable' so that it can simply rethrow without wrapping.
This commit is contained in:
@@ -52,7 +52,7 @@ public class SimpleRetryExceptionHandler extends RetryListenerSupport implements
|
||||
* @see org.springframework.batch.repeat.exception.handler.ExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext,
|
||||
* java.lang.Throwable)
|
||||
*/
|
||||
public void handleException(RepeatContext context, Throwable throwable) throws RuntimeException {
|
||||
public void handleException(RepeatContext context, Throwable throwable) throws Throwable {
|
||||
// Only bother to check the delegate exception handler if we know that
|
||||
// retry is exhausted
|
||||
if (context.hasAttribute(EXHAUSTED)) {
|
||||
|
||||
@@ -54,7 +54,7 @@ public class SimpleRetryExceptionHandlerTests extends TestCase {
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.core.step.item.SimpleRetryExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, java.lang.Throwable)}.
|
||||
*/
|
||||
public void testRethrowWhenRetryExhausted() {
|
||||
public void testRethrowWhenRetryExhausted() throws Throwable {
|
||||
|
||||
RetryPolicy retryPolicy = new NeverRetryPolicy();
|
||||
RuntimeException ex = new RuntimeException("foo");
|
||||
@@ -79,7 +79,7 @@ public class SimpleRetryExceptionHandlerTests extends TestCase {
|
||||
* Test method for
|
||||
* {@link org.springframework.batch.core.step.item.SimpleRetryExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, java.lang.Throwable)}.
|
||||
*/
|
||||
public void testNoRethrowWhenRetryNotExhausted() {
|
||||
public void testNoRethrowWhenRetryNotExhausted() throws Throwable {
|
||||
|
||||
RetryPolicy retryPolicy = new AlwaysRetryPolicy();
|
||||
RuntimeException ex = new RuntimeException("foo");
|
||||
|
||||
Reference in New Issue
Block a user