[REQUEST] Suppress Tracebacks for libraries
See original GitHub issueHow would you improve Rich?
Rich has an excellent Traceback module that improves the formatting and readability of Tracebacks ✨
However, sometimes you don’t just want nice formatting, you actually just want to remove parts of the traceback. This is most common when you are using infrastructure that you know is almost never “relevant” to the traceback itself.
It would be useful if it were possible to suppress Tracebacks for certain libraries/modules/etc, so that a traceback showed more relevant information for users (at the library author’s discretion).
Some context in this twitter thread 😃 https://twitter.com/willmcgugan/status/1439494982180737025
What problem does it solve for you?
There’s a specific use-case here that might be quite common: using rich
in combination with click
. If you’re using click
to build your CLI, then tracebacks will dump several levels of click
modules in addition to the error that is in your codebase. It would be most-useful to me if I could just say “Don’t show any of the click
stuff” 😃
Did I help
If I was able to resolve your problem, consider sponsoring my work on Rich, or buy me a coffee to say thanks.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (4 by maintainers)
Yahoo! Thanks for the iteration, it was fun 🙂
How about something like this:
Then Rich would suppress any stack frame under
click.__file__
?