feat(error-handling): Support specific type error reconstruction from…#15
Merged
feat(error-handling): Support specific type error reconstruction from…#15
Conversation
Contributor
maschnetwork
left a comment
There was a problem hiding this comment.
Great work. Minor comments
examples/src/main/java/com/amazonaws/lambda/durable/examples/ErrorHandlingExample.java
Outdated
Show resolved
Hide resolved
examples/src/test/java/com/amazonaws/lambda/durable/examples/CloudBasedIntegrationTest.java
Show resolved
Hide resolved
sdk-integration-tests/src/test/java/com/amazonaws/lambda/durable/ExceptionIntegrationTest.java
Show resolved
Hide resolved
sdk-integration-tests/src/test/java/com/amazonaws/lambda/durable/ExceptionIntegrationTest.java
Show resolved
Hide resolved
sdk/src/test/java/com/amazonaws/lambda/durable/operation/StepOperationTest.java
Show resolved
Hide resolved
Contributor
Author
|
This is ready for final review now @maschnetwork @zhongkechen . |
Contributor
Author
|
Resolved conflicts with main after merging #19 . @zhongkechen @maschnetwork |
zhongkechen
approved these changes
Jan 27, 2026
maschnetwork
pushed a commit
that referenced
this pull request
Jan 27, 2026
maschnetwork
pushed a commit
that referenced
this pull request
Jan 27, 2026
maschnetwork
added a commit
that referenced
this pull request
Jan 28, 2026
* feat: initial callback design * feat: implemented callback with serdes and samples * Added Callback Serdes * Simplified Callback Tests * Implemented Cloud based testing for callback * Finalize tests * removed temp design * Adapted readme * Adding serdes to config * Adapted readme * Review comments and formatting * add a method to construct TypeToken from Class (#19) * add a method to construct TypeToken from Class * remove resultType from StepOperation * fix tests and examples * revert the accidental changes made by IntelliJ * feat(error-handling): Support specific type error reconstruction from… (#15) * feat: implemented callback with serdes and samples * Implemented Cloud based testing for callback * Formatting * Review fixes and simplifications * Review fixes and simplifications * Review comments * Fixed branches for testing * History Event Process - fix missing cases * Review fixes and simplifications --------- Co-authored-by: Frank Chen <[email protected]> Co-authored-by: Philipp Page <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue Link, if available
#14
Description
This PR implements exception reconstruction to preserve and re-throw original exception types during replay, instead of always wrapping them in
StepFailedException. This improves error handling by allowing users to catch specific exception types.StepFailedExceptionwill still be used as a fallback option in case the original cannot be re-constructed.SerDesimplementation used. For example, when using default Jackson, an Exception class without default constructor would fail to be re-constructed. In this caseStepFailedExceptionwill be re-thrown.The implementation approach changes the
errorTypeproperty of the SDKErrorObjectto include the fully qualified clas name. Based on this name, during reconstruction, we attempt to load the original exception class dynamically using reflection and attempt to deserialize the exception into that type and re-throw it using SneakyThrow.Testing
Unit Tests
Added detailed tests in
StepOperationTest.javaIntegration Tests
Added detailed tests
ExceptionHandlingIntegrationTest.javaExamples
Yes, example was updated and added to SAM template. Cloud based integration test passes.