log an error when a synchronisation fails (#5543)

This commit is contained in:
Frédéric Péters 2014-09-19 12:05:37 +02:00
parent b4f012cd13
commit b439e031ad
1 changed files with 5 additions and 1 deletions

View File

@ -334,7 +334,11 @@ class SyncFromPcfDbView(BrowserView):
if not object in objects:
continue
t0 = time.time()
result = getattr(self, 'sync_'+object)(timestamp)
try:
result = getattr(self, 'sync_'+object)(timestamp)
except:
log.error('error during synchro of %s' % object)
raise
duration = time.time() - t0
report.append('%-14s: %6s [%s]' % (object, result, format_duration(duration)))
log.info('sync: %-14s: %6s [%s]' % (object, result, format_duration(duration)))