If I have the code:
try:
1 / 0
except Exception as e:
my_error = e
#e is sent to the application user end
It returns the text for e
but not the exception name as well. In the case of the code I need this for, the console isn't open at the time and the exception is sent through to the user end when it is caught. At the moment when an exception occurs I can see the error text, but how do I get the name as well.
In the case of the example I'd like for my_error
to be
ZeroDivisionError: #error text
instead of my_error
only being
#error text