How to get the output of an exception as a string, formatted similar to pretty_error?

29 Views Asked by At

Python has a library called pretty_error, which makes exception tracebacks look nicer. I want to catch the exception and store the traceback as a string, but in the same formatting as with pretty_error.

How to get the exception in a string, but with a similar formatting as pretty_error?

FYI: Just do pip install pretty_error and import pretty_error to get prettified errors.

0

There are 0 best solutions below