1. Daniel Miller
  2. sqlalchemy

Commits

Mike Bayer  committed e0761d3

postgres wraps exec's in SQLError catch

  • Participants
  • Parent commits 9a4b026
  • Branches default

Comments (0)

Files changed (1)

File lib/sqlalchemy/databases/postgres.py

View file
  • Ignore whitespace
         to produce this correctly for an executemany, so we do our own executemany here."""
         rowcount = 0
         for param in parameters:
-            c.execute(statement, param)
+            try:
+                c.execute(statement, param)
+            except Exception, e:
+                raise exceptions.SQLError(statement, param, e)
             rowcount += c.rowcount
         self.context.rowcount = rowcount