Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(error-handling): Support specific type error reconstruction from…#15

Merged
phipag merged 3 commits intomainfrom
phipag/error-handling
Jan 27, 2026
Merged

feat(error-handling): Support specific type error reconstruction from…#15
phipag merged 3 commits intomainfrom
phipag/error-handling

Conversation

@phipag
Copy link
Contributor

@phipag phipag commented Jan 22, 2026

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.

StepFailedException will still be used as a fallback option in case the original cannot be re-constructed.

  • One example for such a case is if the Exception class is not serializable by the SerDes implementation used. For example, when using default Jackson, an Exception class without default constructor would fail to be re-constructed. In this case StepFailedException will be re-thrown.

The implementation approach changes the errorType property of the SDK ErrorObject to 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.java

Integration Tests

Added detailed tests ExceptionHandlingIntegrationTest.java

Examples

Yes, example was updated and added to SAM template. Cloud based integration test passes.

@phipag phipag requested a review from maschnetwork January 22, 2026 10:35
@phipag phipag self-assigned this Jan 22, 2026
@phipag phipag linked an issue Jan 22, 2026 that may be closed by this pull request
@phipag phipag requested a review from zhongkechen January 22, 2026 10:38
Copy link
Contributor

@maschnetwork maschnetwork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. Minor comments

@zhongkechen zhongkechen mentioned this pull request Jan 23, 2026
2 tasks
@phipag
Copy link
Contributor Author

phipag commented Jan 26, 2026

This is ready for final review now @maschnetwork @zhongkechen .

@phipag
Copy link
Contributor Author

phipag commented Jan 27, 2026

Resolved conflicts with main after merging #19 . @zhongkechen @maschnetwork

Copy link
Contributor

@maschnetwork maschnetwork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@phipag phipag merged commit ba2f2d5 into main Jan 27, 2026
3 checks passed
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]>
@zhongkechen zhongkechen deleted the phipag/error-handling branch February 26, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Use specific exception types in step error handling

3 participants