Change method signatures to Throwable (from Exception)

This allows use of spring-retry with naughty libraries that use Error
conditions to signal retryable exceptions. Users can still declare their
RetryCallback as "throws Exception" if they want to be conservative.

Also added throwLastExceptionOnExhausted to RetryTemplate to throw
the last exception instead of the ExhaustedRetryException.
This commit is contained in:
Dave Syer
2014-04-22 16:55:14 +01:00
parent 40e7777428
commit dab8602a0e
14 changed files with 273 additions and 229 deletions

View File

@@ -33,5 +33,5 @@ public interface RetryCallback<T> {
* @return the result of the successful operation.
* @throws Exception if processing fails
*/
T doWithRetry(RetryContext context) throws Exception;
T doWithRetry(RetryContext context) throws Throwable;
}