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

How to handle unhandled exceptions within the async methods #469

Open
mvburgh opened this issue Feb 18, 2022 · 2 comments
Open

How to handle unhandled exceptions within the async methods #469

mvburgh opened this issue Feb 18, 2022 · 2 comments

Comments

@mvburgh
Copy link

mvburgh commented Feb 18, 2022

Hi,
I'm having a problem where Stateless is not catching any undhandled exceptions. Say I want to throw an error in one of the steps; how would I handle it outside the steps itself? Current in RELEASE compilation it even gives me a BSOD?

In debug mode i find it throws the exception on this but i dont seem to find a way to handle it (unless I handle it in Step10 function):
.OnEntry(async x => await Step10())

Would appreciate your feedback.

@Cnordbo
Copy link

Cnordbo commented Feb 24, 2022

Have you tried using the .OnEntryAsync method call instead of OnEntry, and use FireAsync when transitioning. (where you normally use Fire) - this could be the root of your issue.

You could also have a look at the OnUnhandledTrigger/OnUnhandledTriggerAsync to create your own behavior for exceptions, i believe. (havent tested it)

@mvburgh
Copy link
Author

mvburgh commented Mar 2, 2022

I have not tried those methods yet. The OnHandledTrigger I'm using but I believe that fires only on undefined triggers.

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