Skip to content

vgauraha62/errmap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ErrMap

A tree-style Python error formatter that replaces the default traceback printer with a clean, colour-coded call tree.

[ERR-MAP] Traceback detected
 root
 └── main_loop (line 12)
      > game_update()
 │    └── game_update (line 9)
           > physics_calc()
 │    │    └── physics_calc (line 6)
               > return 1 / 0

ZeroDivisionError: division by zero

Install

pip install errmap

Usage

from errmap import ErrMap

errmap = ErrMap()
errmap.install()

That's it. From that point on any unhandled exception will print as a tree instead of the default traceback.


API

ErrMap()

Creates a new ErrMap instance.

errmap.install()

Replaces sys.excepthook with the tree formatter.

errmap.active

Set to False to temporarily disable ErrMap and fall back to the default traceback printer.

errmap.active = False  # default traceback
errmap.active = True   # tree formatter

License

MIT

About

A python library for a color-coded error tree replacing python TraceBack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%