You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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" :-).
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.
The text was updated successfully, but these errors were encountered: