repoze/repoze.tm2 — pull request #3 by roaet (2013-06-19 16:38:47+00:00)
Title: Added proper save and reraise

This fix is based off of [similar code in OpenStack](https://github.com/openstack/oslo-incubator/blob/55b35226cf027100248ddcb11d8a7186c1635ddf/openstack/common/excutils.py)

The error I was receiving was the following:
Traceback (most recent call last):
File "openstack/quantum/.venv/local/lib/python2.7/site-packages/eventlet/wsgi.py", line 394, in handle_one_response
for data in result:
File "openstack/quantum/repoze.tm2/repoze/tm/__init__.py", line 28, in __call__
raise
TypeError: exceptions must be old-style classes or derived from BaseException, not NoneType

This was hiding the original exception and was causing serious issues. The logic behind this is that the exception was being lost during the self.abort and the reraise. Saving it now prevents the loss of the exception.