-
Notifications
You must be signed in to change notification settings - Fork 528
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
confusion with on_exception handler #552
Comments
Hello @kpihus,
as of right now all callbacks are tied to the processing of transitions which means only errors happening during transitions are considered. The |
Tnx @aleneum i reached that conclusion by myself also when reading the source, but i wasn't sure about that. Anyway i moved my errors inside transitions and this solved the problem. Tho including MachineErrors into the scope wouldn't hurt i guess, because developers do make mistakes and not all possible errors are handeled properly. |
this is also confusing for me, at some points my code just does not work and I can't understand why, just to realize I called the trigger twice (like a bot trying to walk more than once) without having a reflexive transition on walk state, but the library does not inform me of this, why not just let developers catch does errors instead of suppressing them and give them an option to handle them, which by the way only works on certain cases? |
FYI: Hello @joecabezas,
I am not sure what your observation of transitions 'suppressing' errors is referring to. Do you have a minimal working example of this? If you don't provide |
Closing this since |
Hello,
I have little confusion with on_exeption handler. Did some digging in documentation and in source code, but didnt find any possible solution
Lets take following code for example:
Code tries to execute transition what is not allowed by transitions definitions. One would assume that
transitions.core.MachineError: "Can't trigger event melt from state gas!"
error would be catched and handled byhandle_error
callback, but seems it does not work so.Is there any other mechanism to catch and handle this kind of transition errors?
The text was updated successfully, but these errors were encountered: