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

Cancel state transition when exception is thrown inside observer #184

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

NelsonFrancisco
Copy link

@NelsonFrancisco NelsonFrancisco commented May 17, 2019

#171 related

When you throw an exception inside an observer the FSM state might be updated:

  • If the error is thrown before one specific observer is called (onTransit) then the state would not change
  • If the error is thrown after onTransit observer, then the state is changed.

This PR makes this consistent, and it always reverts the state.
It basically reverts to the previous state when the exception is thrown IF the current state is different from the previous one, defined in the transition.
Promises supported

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

Successfully merging this pull request may close these issues.

1 participant