On Sun, Feb 09 2014,Steven D'Aprano wrote: > On Sun, Feb 09, 2014 at 12:03:43PM +0530, Sivaram Neelakantan wrote: >
[snipped 8 lines] > When you get an error, and don't know how to interpret it, the first > thing to do is to look at the exception and see what it says. > > try: > # as above > except sq.IntegrityError as exception: > print(exception) > dbh.rollback() I'm sorry I wasn't clear but I do know what kind of error is going to come; I was trying to make a more helpful exit by printing out the offending row/row #. When I tried your suggestion above, I get 'UNIQUE constraint failed: users.id ' which I know but not the offending row or row number. sivaram -- _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor