Class RecoveryErrorInfo

java.lang.Object
io.superdurable.dex.RecoveryErrorInfo

public final class RecoveryErrorInfo extends Object
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 Details

    • getAttemptProgress

      public StepAttemptProgress getAttemptProgress()
      Returns the furthest progress across all attempts of the failed Step method.

      StepAttemptProgress.NOT_STARTED means 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

      public String getDetail()
      Returns the failure detail supplied by the Worker or backend.
      Returns:
      the failure detail, or an empty string when unavailable
    • getErrorType

      public String getErrorType()
      Returns the original Worker exception type or backend failure type.
      Returns:
      the error type, or an empty string when unavailable