@@ -223,7 +223,8 @@ public boolean isAbortable(R result, Throwable failure) {
223223
224224 /**
225225 * Registers the {@code listener} to be called when an execution is aborted.
226- * <p>Note: Any exceptions that are thrown from within the {@code listener} are ignored.</p>
226+ * <p>Note: Any exceptions that are thrown from within the {@code listener} are ignored. To provide an alternative
227+ * result for a failed execution, use a {@link Fallback}.</p>
227228 */
228229 public RetryPolicy <R > onAbort (CheckedConsumer <? extends ExecutionCompletedEvent <R >> listener ) {
229230 abortListener = EventListener .of (Assert .notNull (listener , "listener" ));
@@ -234,7 +235,8 @@ public RetryPolicy<R> onAbort(CheckedConsumer<? extends ExecutionCompletedEvent<
234235 * Registers the {@code listener} to be called when an execution attempt fails. You can also use {@link
235236 * #onFailure(CheckedConsumer) onFailure} to determine when the execution attempt fails <i>and</i> and all retries
236237 * have failed.
237- * <p>Note: Any exceptions that are thrown from within the {@code listener} are ignored.</p>
238+ * <p>Note: Any exceptions that are thrown from within the {@code listener} are ignored. To provide an alternative
239+ * result for a failed execution, use a {@link Fallback}.</p>
238240 */
239241 public RetryPolicy <R > onFailedAttempt (CheckedConsumer <? extends ExecutionAttemptedEvent <R >> listener ) {
240242 failedAttemptListener = EventListener .ofAttempt (Assert .notNull (listener , "listener" ));
@@ -244,7 +246,8 @@ public RetryPolicy<R> onFailedAttempt(CheckedConsumer<? extends ExecutionAttempt
244246 /**
245247 * Registers the {@code listener} to be called when an execution fails and the {@link RetryPolicy#withMaxRetries(int)
246248 * max retry attempts} or {@link RetryPolicy#withMaxDuration(Duration) max duration} are exceeded.
247- * <p>Note: Any exceptions that are thrown from within the {@code listener} are ignored.</p>
249+ * <p>Note: Any exceptions that are thrown from within the {@code listener} are ignored. To provide an alternative
250+ * result for a failed execution, use a {@link Fallback}.</p>
248251 */
249252 public RetryPolicy <R > onRetriesExceeded (CheckedConsumer <? extends ExecutionCompletedEvent <R >> listener ) {
250253 retriesExceededListener = EventListener .of (Assert .notNull (listener , "listener" ));
@@ -253,7 +256,8 @@ public RetryPolicy<R> onRetriesExceeded(CheckedConsumer<? extends ExecutionCompl
253256
254257 /**
255258 * Registers the {@code listener} to be called when a retry is about to be attempted.
256- * <p>Note: Any exceptions that are thrown from within the {@code listener} are ignored.</p>
259+ * <p>Note: Any exceptions that are thrown from within the {@code listener} are ignored. To provide an alternative
260+ * result for a failed execution, use a {@link Fallback}.</p>
257261 */
258262 public RetryPolicy <R > onRetry (CheckedConsumer <? extends ExecutionAttemptedEvent <R >> listener ) {
259263 retryListener = EventListener .ofAttempt (Assert .notNull (listener , "listener" ));
@@ -263,7 +267,8 @@ public RetryPolicy<R> onRetry(CheckedConsumer<? extends ExecutionAttemptedEvent<
263267 /**
264268 * Registers the {@code listener} to be called when a retry is about to be scheduled. A retry will actually be
265269 * performed after any scheduled delay.
266- * <p>Note: Any exceptions that are thrown from within the {@code listener} are ignored.</p>
270+ * <p>Note: Any exceptions that are thrown from within the {@code listener} are ignored. To provide an alternative
271+ * result for a failed execution, use a {@link Fallback}.</p>
267272 */
268273 public RetryPolicy <R > onRetryScheduled (CheckedConsumer <? extends ExecutionScheduledEvent <R >> listener ) {
269274 retryScheduledListener = EventListener .ofScheduled (Assert .notNull (listener , "listener" ));
0 commit comments