Skip to content
Snippets Groups Projects
Commit d8fbc0ed authored by Sven Mäder's avatar Sven Mäder :speech_balloon:
Browse files

Add output exception handling

parent 230eafc0
No related branches found
No related tags found
1 merge request!12Deltalogparse
......@@ -110,7 +110,11 @@ def write(entry):
filtered_entry = filtered(entry)
log_action('write', filtered_entry)
deltalog.info('{}'.format(json.dumps(filtered_entry)))
try:
deltalog.info('{}'.format(json.dumps(filtered_entry)))
except:
log.exception('error: writing entry: {} with {}: {}'.format(entry['dn'], req_type, req_dn))
def sleep(start_time):
......@@ -145,7 +149,7 @@ def main():
req_start = req['attributes']['reqStart'][0]
log.info('continuing from last logged req: {}'.format(req_start))
except:
log.exception('error: while trying to retrieve last req')
log.exception('error: trying to retrieve last req')
req_start = datetime.datetime.utcnow().strftime('%Y%m%d%H%M%S.%fZ')
log.info('using current timestamp: {}'.format(req_start))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment