Skip to content

Add new methods to FuncTryTaskBuilder class#1342

Open
mcruzdev wants to merge 3 commits intoserverlessworkflow:mainfrom
mcruzdev:try-catch-func-dsl
Open

Add new methods to FuncTryTaskBuilder class#1342
mcruzdev wants to merge 3 commits intoserverlessworkflow:mainfrom
mcruzdev:try-catch-func-dsl

Conversation

@mcruzdev
Copy link
Copy Markdown
Collaborator

This pull request introduces new builder methods to simplify and extend the configuration of try/catch logic in the fluent function workflow API, and adds comprehensive tests to validate these features.

Enhancements to the try/catch builder API:

  • FuncTryTaskBuilder now exposes new public methods for configuring try/catch blocks in a more expressive and flexible way:
    • try_ for defining the main try tasks
    • catch_ for specifying error handling logic with custom error selection
    • catchWhen for conditional error handling based on expressions
    • catchType for handling errors of a specific type

Testing and validation:

  • Added FuncTryCatchTest to thoroughly test the new try/catch builder methods, covering scenarios such as error type matching, conditional error handling, and compensation logic in workflow tasks

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
@mcruzdev mcruzdev requested a review from fjtirado as a code owner April 24, 2026 22:54
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
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.

1 participant