>>> def a():
... raise TypeError("oops")
...
>>> try:
... a()
... except Exception as e:
... print("{type} raised: {message}".format(type=type(e), message=e))
... raise
...
<type 'exceptions.TypeError'> raised: oops
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "<stdin>", line 2, in a
TypeError: oops
>>>
logging