Newbie needing some help

Chris Angelico rosuav at gmail.com
Fri Aug 8 19:38:19 EDT 2014


On Sat, Aug 9, 2014 at 8:01 AM, Chris Kaynor <ckaynor at zindagigames.com> wrote:
> However, I'd recommend re-raising the exception after rolling back the
> transaction with a bare "raise" statement right after the db.rollback() - at
> the absolute minimum, you should log the error. This will likely let you see
> what your problem is.

AIUI, aborting the process with an uncaught exception would roll back
implicitly, so there's no need to "bare except, roll back, bare
raise". But even if that's not the case, I would be looking at a
try/finally for this, rather than a try/except/raise.

ChrisA



More information about the Python-list mailing list