re-raise of exception loses stack trace information

Issue #628 resolved
Former user created an issue

In mapper.py, there's a spot that catches an exception, assigns it to e, and possibly re-raises e. This has the side of effect of losing the stack trace information that originally raised e. A better method is to just cause "raise" with no arguments (instead of "raise e"). "raise" with no arguments has the effect of re-raising the exception, but shows the actual stack trace to where the error occurred in the user's program, instead of pointing to some irrelevant line in mapper.py.

Patch attached.

I'd write a test case, but I'm an SQL Alchemy newbie and don't yet understand what I'm doing wrong that's causing the exception to begin with...

Comments (2)

  1. Mike Bayer repo owner

    the behavior of this has been improved in 0.4 and reraises properly using an argument-less "raise" of the exception which just occured.

  2. Log in to comment