|
| <prev next> |
[psycopg] #98: 'raise' is better than 'raise err' when reraising errors.: msg#00000python.db.psycopg.devel
#98: 'raise' is better than 'raise err' when reraising errors. -------------------------------------------+-------------------------------- Reporter: docwhat+bugs.psycopg@xxxxxxxx | Owner: fog Type: defect | Status: new Priority: normal | Milestone: Component: psycopg1 | Version: 1.1.21 Severity: normal | Keywords: -------------------------------------------+-------------------------------- psycopg-1.1.21 source:/psycopg1/trunk/ZPsycopgDA/db.py (line 246) does a {{{raise err}}} to re-raise an error instead of just doing {{{raise}}}. This cuts short the tracebacks and call stack, making it hard to find the error that caused this exception. {{{ #!python try: ... except StandardError, err: # Using just raise below would let you just use 'except:' self._abort() raise # using just raise keeps the call stack intact. }}} Ciao! -- Ticket URL: <http://initd.org/tracker/psycopg/ticket/98> psycopg <http://initd.org/> psycopg_______________________________________________ Psycopg mailing list Psycopg-IAPFreCvJWPBWskQ1e/+sw@xxxxxxxxxxxxxxxx http://lists.initd.org/mailman/listinfo/psycopg |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Next by Date: | [psycopg] #99: Patch for cursor.execute and cursor.executemany to return cursor object: 00000, psycopg |
|---|---|
| Next by Thread: | [psycopg] #99: Patch for cursor.execute and cursor.executemany to return cursor object: 00000, psycopg |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |