Class ErrorHandlingExample
java.lang.Object
software.amazon.lambda.durable.DurableHandler<Object,String>
software.amazon.lambda.durable.examples.ErrorHandlingExample
- All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.RequestStreamHandler
Example demonstrating error handling patterns with the Durable Execution SDK.
This example shows how to handle:
StepFailedException- when a step exhausts all retry attemptsStepInterruptedException- when an AT_MOST_ONCE step is interrupted- Custom exceptions - original exception types are preserved and can be caught directly
Note: NonDeterministicExecutionException is thrown by the SDK when code changes between executions (e.g.,
step order/names changed). It should be fixed in code, not caught.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCustom exception to demonstrate that original exception types are preserved across checkpoints. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleRequest(Object input, DurableContext context) Handle the durable execution.Methods inherited from class software.amazon.lambda.durable.DurableHandler
createConfiguration, createObjectMapper, getConfiguration, handleRequest
-
Constructor Details
-
ErrorHandlingExample
public ErrorHandlingExample()
-
-
Method Details
-
handleRequest
Description copied from class:DurableHandlerHandle the durable execution.- Specified by:
handleRequestin classDurableHandler<Object,String> - Parameters:
input- User inputcontext- Durable context for operations- Returns:
- Result
-