Class RetryAfterException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.superdurable.dex.exceptions.RetryAfterException
- All Implemented Interfaces:
Serializable
Requests a specific delay before retrying a failed Step method.
Throw the value returned by after(Duration, Throwable) from wait-for or execute. On
Temporal, the delay overrides only the next retry interval; retry limits and timeouts remain
unchanged, and the current attempt failure remains the reported Worker error. Cadence rejects
dynamic retry intervals with a Flow validation error.
throw RetryAfterException.after(Duration.ofSeconds(30), currentFailure);
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic RetryAfterExceptionCreates a retry request while preserving the current attempt failure.Returns the requested delay before the next retry.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Method Details
-
after
Creates a retry request while preserving the current attempt failure.- Parameters:
retryAfter- the positive whole-second delay before the next attemptcurrentCause- the current Step method attempt failure reported to Dex- Returns:
- an exception to throw from the Step method
- Throws:
IllegalArgumentException- if the delay is null, nonpositive, fractional, or exceeds the signed 32-bit seconds range, or if the current cause is null
-
getRetryAfter
Returns the requested delay before the next retry.- Returns:
- the positive whole-second retry delay
-