2 Mar 2006 22:11
[psycopg] #98: 'raise' is better than 'raise err' when reraising errors.
#98: 'raise' is better than 'raise err' when reraising errors.
-------------------------------------------+--------------------------------
Reporter: docwhat+bugs.psycopg <at> gerf.org | 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/>
(Continue reading)
RSS Feed