Previously we used sys.exc_info for handled errors (unless the traceback option was provided), which may not be very useful — it shows where notify was called, not where the error was raised
Since Python 3, exception objects have a __traceback__ attribute that fixes this
Now we get the traceback in the following order of priority:
the traceback option
the exception.__traceback__ attribute
sys.exc_info
We still need to read sys.exc_info for cases where a non-exception has been provided to notify — this isn't really a supported use-case but we do currently handle this
Goal
Previously we used
sys.exc_info
for handled errors (unless thetraceback
option was provided), which may not be very useful — it shows wherenotify
was called, not where the error was raisedSince Python 3, exception objects have a
__traceback__
attribute that fixes thisNow we get the traceback in the following order of priority:
traceback
optionexception.__traceback__
attributesys.exc_info
We still need to read
sys.exc_info
for cases where a non-exception has been provided tonotify
— this isn't really a supported use-case but we do currently handle this