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

Error propagation from entry actions execution using interpreter #2954

Closed
ahamid opened this issue Jan 20, 2022 · 2 comments
Closed

Error propagation from entry actions execution using interpreter #2954

ahamid opened this issue Jan 20, 2022 · 2 comments

Comments

@ahamid
Copy link

ahamid commented Jan 20, 2022

Description

Same as #463 but specifically for automatic entry (and presumably exit) actions which are invoked automatically by the state machine / scheduler, so cannot be caught by calling code. Is the alternative to convert all actions to explicit states with internal service calls (which can fail/be rejected, and handled via state machine definition)? That seems a bit cumbersome.

Expected Result
Interpreter should have a mechanism for errors to be caught / propagate outside.

Actual Result
Error is thrown from within interpreter and cannot be handled by state machine definition.

Reproduction
Slight variant of @davydof's example on #463, but executing an automatic entry action:
https://xstate.js.org/viz/?gist=cb72b4656ce8f440b2f1704b4e33a99b

Error is thrown from within interpreter/scheduler:

this.exec(action, state, actionsConfig);

@Andarist
Copy link
Member

At the moment how errors are handled in the runtime is a little bit under-specified. We are aware of the issue and we plan to address it. I've created an RFC going into more details - I would appreciate it if you could take a look at it and give feedback about those proposed changes: https://github.com/statelyai/rfcs/pull/4/files

@Andarist
Copy link
Member

I believe that #4145 & #4492 addressed this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants