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

How to access exceptions on aborted outcomes? #899

Closed
sillkjc opened this issue Dec 12, 2024 · 2 comments
Closed

How to access exceptions on aborted outcomes? #899

sillkjc opened this issue Dec 12, 2024 · 2 comments

Comments

@sillkjc
Copy link

sillkjc commented Dec 12, 2024

Hi all,
The RAFCON documentation states that exceptions raised within states will flow up to their parents until the 'Aborted' outcome is connected into a state.
Is there a way to get access to the original Exception object (from the child) inside the state the aborted outcome connects to? We wish see the Exception type, message, error code etc. so we can handle it appropriately with a high level exception handler state.

For hierarchy states, the child states together with the transitions determine the outcome. As soon as during the execution of a hierarchy state a transitions leads to an outcome of the hierarchy state, the state is left on this outcome. However, if an exception or error occurs in a child state, which is not caught (by connecting the “aborted” outcome of the erroneous state), the hierarchy state is left also on the “aborted” outcome. By this, errors and exception climb up the hierarchy, until an “aborted” outcome is connected or the root state is reached (and the program stops).

Many thanks

@sebastian-brunner
Copy link
Member

Yes you can. It's mapped to inputs["error"] of the abortion-handling state.

There is also an example here: https://github.com/DLR-RM/RAFCON/tree/master/source/rafcon/share/rafcon/examples/functionality_examples/hierarchy_abortion_handling

@JohannesErnst
Copy link
Collaborator

@sillkjc Did this work for you? If so please close the issue

@sillkjc sillkjc closed this as completed Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants