📜 ⬆️ ⬇️

Beautiful tracebacks in Python

How often do you receive similar error reports?

Traceback (most recent call last): ... File "...", line ..., in ... process(lst[index]) IndexError: list index out of range 


Oh, if only to know the value of lst and index at that time ...
')
python-catcher - automatic generation of HTML tracebacks with local variables and source codes, + uploading to the Internet - use for health.





An example of the actual report: ajenti.org/catcher/view/10

Usage example:

 import catcher try: launch_important_stuff() except Exception, e: report = catcher.collect(e) html = catcher.formatters.HTMLFormatter().format(report, maxdepth=4) url = catcher.uploaders.AjentiOrgUploader().upload(html) print 'Application has crashed. Please submit this link along with the bug report:' print url 


PyPI , Github , fresh deb here .

More and nothing to add :)

Source: https://habr.com/ru/post/188400/


All Articles