Error handling in PANOPTES

Dear all,

I am still slowly trying out things, and studying PANOPTES code.
I was curious about the main concept behind error handling in pocs, more specifically, at which level should try-except block be put, and when things should be raised or re-raised.

My main point of interest, is to understand how one always ensure that the state machine will properly handle any error, and go back to the safest state.

Thank you in advance for your help.

Answering my own question, long time after I started this adventure.

From what I saw, all errors are expected to be catch inside manager. Everytime a state requests a feature from the manager (open dome, close dome, park everything, do useful stuff, …) then the manage should return a boolean, but not raise any exception.

Either everything went ok: the boolean is true
Or something was wrong (exception caught, or wrong value somwhere) and the return value is False.

In the later case, the State is supposed to managed the right behaviour by itself. Usually by providing a default next_state to parking.

There is also a builtin security behaviour directly within the StateMachine in case of uncaught exception in one of the state or transition: Inside the main loop in the run method.
The very last hope lies inside this method.