-
Notifications
You must be signed in to change notification settings - Fork 4.4k
chore(stepfunctions): added an ICatchable interface for step function states #35812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
chore(stepfunctions): added an ICatchable interface for step function states #35812
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This review is outdated)
|
This looks good to me. We could consider declaring some of the actual catchable classes as implementing |
|
Make sense will update the code, Thanks :) |
3efcc7b to
42bc4d0
Compare
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
|
@wimlewis-amazon Can you review the changes? Do they looks good? |
|
@wimlewis-amazon @pahud This PR is ready for review! |
|
These changes look good to me! (The re-typing to (I'm not associated with the CDK project, so I can't officially approve the PR, but 👍 anyway) |
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
1 similar comment
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
b516554 to
5ec3db1
Compare
Issue #35608
Closes #35608
Reason for this change
The Step Functions module currently lacks a type-safe way to represent states that support error handling via
.addCatch().When building reusable Step Function constructs or patterns, developers often need to specify that a state supports catching errors — similar to how INextable and IChainable express chaining behavior.
Adding an ICatchable interface improves type safety, clarity, and discoverability for these use cases.
Description of changes
Added a new ICatchable interface to aws-stepfunctions/lib/types.ts.
Defined the interface as:
No breaking changes — this is a purely additive enhancement.
Enables reusable constructs to define parameters as IChainable & ICatchable for stronger type guarantees.
Describe any new or updated permissions being added
N/A – No new IAM permissions are introduced by this change.
Description of how you validated changes
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license