Skip to content
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

[ Documentation request ] Java Workflows must not catch Throwables and DestroyWorkflowThreadError #3191

Open
artemik opened this issue Nov 3, 2024 · 1 comment

Comments

@artemik
Copy link

artemik commented Nov 3, 2024

Brief description

In Java SDK, thread yielding/release from user's workflow code works based on throwing DestroyWorkflowThreadError on Temporal library calls to break out of user's workflow code execution. It means user workflow code must not catch DestroyWorkflowThreadError/Error/Throwable. This is a crucial fact but is missing in documentation.

Even though common pattern for devs is to catch just Exception:

try {
    ...
} catch (Exception e) {
    ...
}

some prefer to catch Throwable, which would break Temporal.

Your recommended content

@fairlydurable
Copy link
Contributor

Thank you for sending over this feedback. Do you have specific points in the documentation you can point me to where this error happens?

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

No branches or pull requests

2 participants