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

Exceptionhandling in guards #608

Open
vghero opened this issue Nov 19, 2018 · 0 comments
Open

Exceptionhandling in guards #608

vghero opened this issue Nov 19, 2018 · 0 comments

Comments

@vghero
Copy link

vghero commented Nov 19, 2018

Actions seem to support error handling from which I can set machine error state and even the occurred exception in the extended state to evaluate it at the caller. That's fine.

Now I started to play with Guards and it seems they don't have an exception handling, which seems by design. Any error is catched and false is returned. On first sight, that might make sense, but in combination with Choice, that leads to unwanted results.

E.g. I have a Choice, where a Guard is called. When the result is true it calls my action, if it is false it simply transitions to another state (else). When now an error occurs in the Guard (e.g. I did a NPE on accident), it results to false moving the machine into a state, I don't want it to be. Since it was a technical error that should not do any transition at all but set the machine to an error state (or at least provide a callback to do so). But maybe I'm missing something here?

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

1 participant