You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Python 3.11, exceptions have gained the ability to have notes added to them via an add_note method. Standard tracebacks render these as additional lines under the main error message:
try:
raiseKeyError("key")
exceptExceptionase:
e.add_note("Unexpected error while calling LLM.")
raisee
Traceback (most recent call last):
File "/Users/david/repos/eva/insights/e.py", line 15, in <module>
raise e
File "/Users/david/repos/eva/insights/e.py", line 12, in <module>
raise KeyError("key")
KeyError: 'key'
Unexpected error while calling LLM.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In Python 3.11, exceptions have gained the ability to have notes added to them via an
add_note
method. Standard tracebacks render these as additional lines under the main error message:Rich tracebacks currently omit these:
But they should probably include them? Notes might contain relevant info that's useful for debugging the issue that caused the exception.
Not sure what the aesthetics should be, here's some prior art from
rustc
to get ideas going (see lines with= note:
):Beta Was this translation helpful? Give feedback.
All reactions