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 errors occurring during outputs? #28

Open
manishtomar opened this issue Aug 22, 2016 · 1 comment
Open

How to handle errors occurring during outputs? #28

manishtomar opened this issue Aug 22, 2016 · 1 comment

Comments

@manishtomar
Copy link

Unfortunately, our world is filled with side-effects which are out of our control and can result in errors. Based on a short chat with @glyph exceptions occurring when executing outputs will just bubble up resulting the machine to be in an unexpected state. What is the best way to handle this? Would an API to move to another state on error make sense? Maybe an example with current API will be nice.

@glyph
Copy link
Owner

glyph commented Aug 23, 2016

One major problem here is that if a transition requires multiple outputs, and one of them that isn't the last one fails, what happens to the un-called outputs? Do we blindly proceed along, calling each one, and just noticing if it fails? Do we put it into the new state even if the exception prevented execution of the later outputs? It seems difficult to preserve any useful invariants once an unexpected exception has interrupted some code in the middle.

Right now, I think the best practice for automat is "don't have errors" :-).

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