zerotk.reraiseit

Reraise exceptions.


Keywords
exception, raise, reraise
License
GPL-3.0
Install
pip install zerotk.reraiseit==2.0.7

Documentation

PyPI Travis Coveralls

zerotk.reraiseit

A function to re-raise exceptions adding information to the traceback and with unicode support.

from zerotk.reraiseit import reraise

try:
  raise RuntimeError('An error occurred')
except Exception as e:
  reraise(e, '')

This will produce the following output:

(... traceback ...)
RuntimeError:
While testing reraise.
An error occurred

As you can see, it added a message to the exception and re-raise it.