aboutsummaryrefslogtreecommitdiffstats
path: root/sync.py
diff options
context:
space:
mode:
authorAsbjørn Sloth Tønnesen <ast@fiberby.net>2019-09-07 13:05:13 +0000
committerAsbjørn Sloth Tønnesen <ast@fiberby.net>2019-09-07 13:05:13 +0000
commit4d60befb6d323adb638941d41ba7f5fda9f070cc (patch)
treee9c8de699bee2afbd3833876a31a0b95c6636011 /sync.py
parentba9677bb29a3a7db7618133be5e4e1a9248e5059 (diff)
downloadpeeringdb-simplesync-4d60befb6d323adb638941d41ba7f5fda9f070cc.tar.gz
peeringdb-simplesync-4d60befb6d323adb638941d41ba7f5fda9f070cc.tar.xz
peeringdb-simplesync-4d60befb6d323adb638941d41ba7f5fda9f070cc.zip
print the data that triggered an error
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Diffstat (limited to 'sync.py')
-rwxr-xr-xsync.py6
1 files changed, 5 insertions, 1 deletions
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 {}.{};'