Mark RetryException#getCause non null

This commit simplifies RetryException to always require a root cause
and mark it as not nullable. Such exception is the exception thrown by
the retryable operation and should always be available as it explains
why the invocation was a candidate for retrying in the first place.

Closes gh-35332
This commit is contained in:
Stéphane Nicoll
2025-08-16 09:14:59 +02:00
parent 498b0c231b
commit 532911eb93
2 changed files with 10 additions and 10 deletions
@@ -112,8 +112,7 @@ public abstract class AbstractRetryInterceptor implements MethodInterceptor {
});
}
catch (RetryException ex) {
Throwable cause = ex.getCause();
throw (cause != null ? cause : new IllegalStateException(ex.getMessage(), ex));
throw ex.getCause();
}
}