Class RecoveryErrorInfo
java.lang.Object
io.superdurable.dex.RecoveryErrorInfo
Describes the final failure that caused a Step method recovery.
Read this value from Context.getRecoveryError(). Errors returned by a Worker preserve
their original Java type name and detail. Server failures retain their failure type.
Read getAttemptProgress() before deciding whether side effects may have happened.
RecoveryErrorInfo error = context.getRecoveryError();
if (error != null) {
logger.warn("Recovering from {}: {}", error.getErrorType(), error.getDetail());
}
-
Method Summary
Modifier and TypeMethodDescriptionReturns the furthest progress across all attempts of the failed Step method.Returns the failure detail supplied by the Worker or backend.Returns the original Worker exception type or backend failure type.
-
Method Details
-
getAttemptProgress
Returns the furthest progress across all attempts of the failed Step method.StepAttemptProgress.NOT_STARTEDmeans the handler did not run in any attempt. Other values require recovery code to allow for side effects from an incomplete attempt.RecoveryErrorInfo error = context.getRecoveryError(); if (error != null && error.getAttemptProgress() == StepAttemptProgress.NOT_STARTED) { logger.info("No handler side effects need reconciliation"); }- Returns:
- the progress reported by the Server; never null
-
getDetail
Returns the failure detail supplied by the Worker or backend.- Returns:
- the failure detail, or an empty string when unavailable
-
getErrorType
Returns the original Worker exception type or backend failure type.- Returns:
- the error type, or an empty string when unavailable
-