Browse Source

Improve wording for retry exceptions

pull/35447/head
Sam Brannen 4 months ago
parent
commit
e93a6a7230
  1. 8
      spring-core/src/main/java/org/springframework/core/retry/RetryException.java
  2. 15
      spring-core/src/main/java/org/springframework/core/retry/RetryListener.java

8
spring-core/src/main/java/org/springframework/core/retry/RetryException.java

@ -20,7 +20,7 @@ import java.io.Serial; @@ -20,7 +20,7 @@ import java.io.Serial;
import java.util.Objects;
/**
* Exception thrown when a {@link RetryPolicy} has been exhausted.
* Exception thrown when a {@link RetryPolicy} has been exhausted or interrupted.
*
* <p>A {@code RetryException} will typically contain the last exception thrown
* by the {@link Retryable} operation as the {@linkplain #getCause() cause} and
@ -31,9 +31,9 @@ import java.util.Objects; @@ -31,9 +31,9 @@ import java.util.Objects;
* {@linkplain Thread#sleep(long) sleeping} for the current
* {@link org.springframework.util.backoff.BackOff BackOff} duration, a
* {@code RetryException} will contain the {@code InterruptedException} as the
* {@linkplain #getCause() cause} and any exceptions from previous attempts to
* invoke the {@code Retryable} operation as {@linkplain #getSuppressed()
* suppressed exceptions}.
* {@linkplain #getCause() cause} and any exceptions from previous invocations
* of the {@code Retryable} operation as {@linkplain #getSuppressed() suppressed
* exceptions}.
*
* @author Mahmoud Ben Hassine
* @author Juergen Hoeller

15
spring-core/src/main/java/org/springframework/core/retry/RetryListener.java

@ -64,9 +64,9 @@ public interface RetryListener { @@ -64,9 +64,9 @@ public interface RetryListener {
/**
* Called if the {@link RetryPolicy} is exhausted.
* @param retryPolicy the {@code RetryPolicy}
* @param retryable the {@code Retryable} operation
* @param retryable the {@link Retryable} operation
* @param exception the resulting {@link RetryException}, with the last
* exception thrown by the {@link Retryable} operation as the cause and any
* exception thrown by the {@code Retryable} operation as the cause and any
* exceptions from previous attempts as suppressed exceptions
* @see RetryException#getCause()
* @see RetryException#getSuppressed()
@ -76,13 +76,12 @@ public interface RetryListener { @@ -76,13 +76,12 @@ public interface RetryListener {
}
/**
* Called if an {@link InterruptedException} is encountered while
* {@linkplain Thread#sleep(long) sleeping} between retry attempts.
* Called if the {@link RetryPolicy} is interrupted between retry attempts.
* @param retryPolicy the {@code RetryPolicy}
* @param retryable the {@code Retryable} operation
* @param exception the resulting {@link RetryException}, with the
* {@code InterruptedException} as the cause and any exceptions from previous
* retry attempts as suppressed exceptions
* @param retryable the {@link Retryable} operation
* @param exception the resulting {@link RetryException}, with an
* {@link InterruptedException} as the cause and any exceptions from previous
* invocations of the {@code Retryable} operation as suppressed exceptions
* @see RetryException#getCause()
* @see RetryException#getSuppressed()
* @see RetryException#getRetryCount()

Loading…
Cancel
Save