mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-22 05:49:04 +00:00
Include current exception in log message for failed retry attempt
Prior to this commit, we included the initial exception in the log message for the initial invocation of a retryable operation; however, we did not include the current exception in the log message for subsequent attempts. For consistency, we now include the current exception in log messages for subsequent retry attempts as well. Closes gh-35433
This commit is contained in:
@@ -178,7 +178,7 @@ public class RetryTemplate implements RetryOperations {
|
||||
return result;
|
||||
}
|
||||
catch (Throwable currentException) {
|
||||
logger.debug(() -> "Retry attempt for operation '%s' failed due to '%s'"
|
||||
logger.debug(currentException, () -> "Retry attempt for operation '%s' failed due to '%s'"
|
||||
.formatted(retryableName, currentException));
|
||||
this.retryListener.onRetryFailure(this.retryPolicy, retryable, currentException);
|
||||
exceptions.add(currentException);
|
||||
|
||||
Reference in New Issue
Block a user