-
Notifications
You must be signed in to change notification settings - Fork 21
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
Error handling #10
Comments
I wouldn't. Better make sure the string passed to Here's a line from the choo readme that summarizes why:
Do you feel like there would be a good case for managing invalid transitions internally? I could imagine two ways this could work. Maybe:
For now I try to make sure I emit only registered event names. I hope this helps :) edit: |
@vorg hey, yeah - so the idea behind throwing an error here is that you've made a mistake in the logic. In any given scenario, if you hit an invalid transition, there's no good way to recover from that. Which state did you intend to go? Which state should we be in to recover? There's no good answer. So we throw, and hope a developer spots the mistake and fixes the source. As per choojs/nanocomponent#43 for use within Does this make sense? |
I'm going to prioritize that next, should be a fairly easy addition. |
Hi,
Yes it makes sense. For now i can also validate potential changes by
accessing machine.transitions which is enough for me.
On Mon, 12 Feb 2018 at 16:44, Bret Comnes ***@***.***> wrote:
I'm going to prioritize that next, should be a fairly easy addition.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKb-Q7oRFQD-jbM4-sWDr71Exnh6lywks5tUGqJgaJpZM4SASW8>
.
--
Marcin Ignac
|
Currently emitting invalid state transition emits error
nanostate.emit: invalid transition ${this.state} -> ${eventName}
.Do you have any ideas on how to handle those errors? E.g.
The text was updated successfully, but these errors were encountered: