JKI-State-Machine icon indicating copy to clipboard operation
JKI-State-Machine copied to clipboard

Feature Idea: Error Handler frame receives previous (error producing) state as Argument

Open jimkring opened this issue 6 years ago • 2 comments

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 image

Step 2 - JKI SM forces the Error Handler frame to execute image

Possibilities - Custom Error Handling for Different States image

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?

jimkring avatar Dec 07 '18 23:12 jimkring

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.

image

francois-normandin avatar Jun 01 '19 13:06 francois-normandin

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: image

image

Tom-McQuillan avatar Jul 02 '24 11:07 Tom-McQuillan

Hy, this is our idea that is used in our company. Maybe it's a little inspiration.

image

image

image

oipatet avatar Aug 02 '24 07:08 oipatet