JKI-State-Machine
JKI-State-Machine copied to clipboard
Feature Idea: Error Handler frame receives previous (error producing) state as Argument
One thing that people have asked for is to know which frame caused an error. Currently, the JKI State Machine will detect that an error has occurred and then will execute the Error Handler frame instead processing the remaining state queue:
Step 1 - Error Occurs
Step 2 - JKI SM forces the Error Handler frame to execute
Possibilities - Custom Error Handling for Different States
Open Questions and Considerations
- Should such specialized error handling be done inside the actual frame that generated the error, instead of putting it into the catch all Error Handler?
- Should arguments of the state call (where the error occurred) also be included, or just the state name that generated the error? (Maybe the arguments passed to the state contribute to the error)
- Should we, instead, make the Previous State available to all frames of the JKI State Machine (e.g. as an additional output to the Parse State Queue), instead only adding it to the Error Handler as an argument?
I personally like this idea very much. My preference would be to pass the previous state with arguments, so that one could reuse the same method to parse in the error handler case.
I've been after this for sometime. After seeing #14 I was hoping this was already a feature I had somehow missed. However this feature does not appear in the current build :(
My ideal solution:
Hy, this is our idea that is used in our company. Maybe it's a little inspiration.