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
Traceback (most recent call last):
File "/home/beanaroo/Projects/foo/main.py", line 98, in <module>
raise Exception('Environment not configured. Missing FOO setting.') from None
Exception: Environment not configured. Missing FOO setting.
Output (with handler)
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/beanaroo/Projects/foo/main.py:676 in __getitem__ │
│ │
│ 673 │ │
│ 674 │ def __getitem__(self, key): │
│ 675 │ │ try: │
│ ❱ 676 │ │ │ value = self._data[self.encodekey(key)] │
│ 677 │ │ except KeyError: │
│ 678 │ │ │ # raise KeyError with the original key value │
│ 679 │ │ │ raise KeyError(key) from None │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: b'FOO'
During handling of the above exception, another exception occurred:
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/beanaroo/Projects/foo/main.py:96 in <module> │
│ │
│ 93 traceback.install() │
│ 94 │
│ 95 try: │
│ ❱ 96 │ foo = os.environ['FOO'] │
│ 97 except KeyError: │
│ 98 │ raise Exception('Environment not configured. Missing FOO setting.') from None │
│ 99 │
│ │
│ /home/mike/.pyenv/versions/3.9.0/lib/python3.9/os.py:679 in __getitem__ │
│ │
│ 676 │ │ │ value = self._data[self.encodekey(key)] │
│ 677 │ │ except KeyError: │
│ 678 │ │ │ # raise KeyError with the original key value │
│ ❱ 679 │ │ │ raise KeyError(key) from None │
│ 680 │ │ return self.decodevalue(value) │
│ 681 │ │
│ 682 │ def __setitem__(self, key, value): │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 'FOO'
During handling of the above exception, another exception occurred:
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/beanaroo/Projects/foo/main.py:98 in <module> │
│ │
│ 95 try: │
│ 96 │ foo = os.environ['FOO'] │
│ 97 except KeyError: │
│ ❱ 98 │ raise Exception('Environment not configured. Missing FOO setting.') from None │
│ 99 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
Exception: Environment not configured. Missing FOO setting.
Alternative
fromrichimporttracebacktraceback.install()
try:
bar=os.environ['BAR']
exceptKeyErroraserr:
raiseException('A problem occurred when setting up bar') fromerr
Expected Output
The above exception was the direct cause of the following exception:
Actual Output
During handling of the above exception, another exception occurred:
Platform
Python 3.9.0 venv on Arch Linux with Rich 9.3.0 using any terminal
The text was updated successfully, but these errors were encountered:
Describe the bug
PEP 409 allows you to suppress exception context. This does not appear to have an effect after installing the rich traceback handler.
To Reproduce
Output (without handler)
Output (with handler)
Alternative
Expected Output
Actual Output
Platform
Python 3.9.0 venv on Arch Linux with Rich 9.3.0 using any terminal
The text was updated successfully, but these errors were encountered: