$ pip install reraise
import reraise
try:
1 / 0
except ZeroDivisionError:
reraise(ValueError("Can't divide by zero!"))
import reraise
class MyCustomException(IOError):
pass
try:
open('file_not_exits')
except IOError:
reraise(MyCustomException)
Created by:
- David Cramer - dcramer
Contributors:
- Bruno Rocha - rochacbruno