psycopg2: proper positioning of .commit() within try: except: blocks

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Sep 8 21:48:32 EDT 2024


On 9/09/24 2:13 am, Karsten Hilbert wrote:
> For what it's worth here's the current state of code:

That code doesn't inspire much confidence in me. It's far too
convoluted with too much micro-management of exceptions.

I would much prefer to have just *one* place where exceptions are
caught and logged.

-- 
Greg


More information about the Python-list mailing list