Class DurableApiErrorClassifier
java.lang.Object
software.amazon.lambda.durable.util.DurableApiErrorClassifier
Classifies AWS service exceptions from Durable Execution API calls as non-retryable or retryable.
Returns UnrecoverableDurableExecutionException with retryable=false for non-retryable customer
errors (e.g., KMS key misconfiguration), or retryable=true for retryable errors (throttling, server errors,
stale checkpoint tokens).
To add a new non-retryable error, add its error code to NON_RETRYABLE_ERROR_CODES.
-
Method Summary
Modifier and TypeMethodDescriptionclassifyException(software.amazon.awssdk.awscore.exception.AwsServiceException e) Classifies the given exception and returns the appropriate exception to throw.
-
Method Details
-
classifyException
public static UnrecoverableDurableExecutionException classifyException(software.amazon.awssdk.awscore.exception.AwsServiceException e) Classifies the given exception and returns the appropriate exception to throw.Returns
UnrecoverableDurableExecutionExceptionwithretryable=falsefor non-retryable customer errors, orretryable=truefor retryable errors.Classification rules:
- Error code in
NON_RETRYABLE_ERROR_CODES→ non-retryable (retryable=false) - 4xx + "Invalid Checkpoint Token" → retryable (
retryable=true, stale token resolves on retry) - 4xx (non-429) → non-retryable (
retryable=false, customer error) - 429, 5xx, unknown → retryable (
retryable=true)
- Parameters:
e- the AWS service exception from a Durable Execution API call- Returns:
- an
UnrecoverableDurableExecutionExceptionfor all cases, with the retryable flag set accordingly
- Error code in
-