From: Vincent Le Gallic Date: Fri, 16 May 2014 16:10:48 +0000 (+0200) Subject: verbose error X-Git-Url: http://gitweb.pimeys.fr/?a=commitdiff_plain;h=e7d59aa6487194be8d9d59bd152afb2e2c754b18;p=dtc.git verbose error --- diff --git a/dtc.py b/dtc.py index d9cd465..ae83166 100755 --- a/dtc.py +++ b/dtc.py @@ -59,7 +59,10 @@ if __name__ == "__main__": last = last_inserted() for q in l: if q["id"] > last: - insert(q) + try: + insert(q) + except psycopg2.IntegrityError: + print "Bim. l,last_inserted = %s" % (l, last_inserted) else: id = int(sys.argv[1]) try: