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
I ran into local error handling that I wasn't quite expecting from the docs and while I found the syntax that works, I wonder if someone can provide any insights into whether this is the intended way of handling local errors in nested state machines.
This is my initial state machine, with the intent to handle bad [cd ]+ sequences via the bad_cd action:
However, surprisingly this generates a state machine that calls cd_val and bad_cd in the same transition, such as 2 > 3 or 2 > 1.
I was ready to chalk it up to a bug, but then I realized that the local error might be called for the inner state machine cd_sp as if it's a standalone definition, so either ; or x would be considered invalid for it and I used the local error syntax with outer state machine name, like this (note main in cd_sp).
, which generated a state machine I originally expected:
The docs have a sentence about sub-definitions, but just say that it is considered useful and provide no additional detail or examples. So, the question is whether this is how one would handle local errors in inner state machines or there is a more appropriate approach for this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I ran into local error handling that I wasn't quite expecting from the docs and while I found the syntax that works, I wonder if someone can provide any insights into whether this is the intended way of handling local errors in nested state machines.
This is my initial state machine, with the intent to handle bad
[cd ]+
sequences via thebad_cd
action:However, surprisingly this generates a state machine that calls
cd_val
andbad_cd
in the same transition, such as2 > 3
or2 > 1
.I was ready to chalk it up to a bug, but then I realized that the local error might be called for the inner state machine
cd_sp
as if it's a standalone definition, so either;
orx
would be considered invalid for it and I used the local error syntax with outer state machine name, like this (notemain
incd_sp
)., which generated a state machine I originally expected:
The docs have a sentence about sub-definitions, but just say that it is considered useful and provide no additional detail or examples. So, the question is whether this is how one would handle local errors in inner state machines or there is a more appropriate approach for this.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions