How to display a nice Error stack when receiving an error event?
|
|
---|---|
Dear PyTango experts and users, I'm still a newbee in PyTango, so sorry if I missed something obvious. I was trying to execute an old piece of code I found in some old training slides and I was trying to update the code to make it work with latest pytango and with python3. I have been using latest itango conda package to try out the code. I encountered a problem when trying to use the tango.Except.print_error_stack method with the errors received from an EventData object as parameter. Here is the code:
If I stop the TangoTest device server to generate an error event, here is what is displayed:
It looks like tango.DevErrorList type does not exist in pytango so we cannot really use tango.Except.print_error_stack method. Is there any alternative method to display nicely the errors received in an event?
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new. |
|
|
---|---|
Hi Reynald Yes, I see the tango.DevErrorList type isn't exposed in Python. I don't see an easy way to use tango.Except.print_error_stack(). I didn't even know it existed! The standard string representation of the error objects will give you a nice way to see the errors:
Example of usage and error. Here the device isn't configured correctly, so we get errors (using stateless=True to keep getting errors via the event system).
If you are just doing simple testing, there is a built-in class that handles all types of events nicely. It just prints out the first error message in the list:
Regards, Anton |