From 4d60befb6d323adb638941d41ba7f5fda9f070cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= Date: Sat, 7 Sep 2019 13:05:13 +0000 Subject: print the data that triggered an error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Asbjørn Sloth Tønnesen --- sync.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sync.py b/sync.py index 340b6be..cf81404 100755 --- a/sync.py +++ b/sync.py @@ -77,7 +77,11 @@ def update_object(kind, obj): t[key] = None t['data'] = json.dumps(obj) cur = conn.cursor() - cur.execute(comp, t) + try: + cur.execute(comp, t) + except: + print(kind, t['id'], t['data']) + raise def last_updated(kind): comp = sql.SQL('SELECT EXTRACT(EPOCH FROM MAX(updated)) - 1 FROM {}.{};' -- cgit v1.2.1