new: Log exceptions as well

pull/14/head
Hannah Ward 2017-06-21 16:01:12 +01:00
parent f417e8a260
commit 503f37ce14
No known key found for this signature in database
GPG Key ID: 6F3BAD60DE190290
1 changed files with 15 additions and 6 deletions

View File

@ -99,11 +99,20 @@ for server in config:
log.debug("Auth set.")
for collection in server["collections"]:
log.debug("Polling %s", collection)
for content_block in cli.poll(collection_name=collection):
log.debug("Pushing block %s", content_block)
localClient.push(content_block.content.decode("utf-8"),
collection_names=localConfig["collections"],
content_binding=content_block.binding,
uri=localInbox)
try:
for content_block in cli.poll(collection_name=collection):
try:
log.debug("Pushing block %s", content_block)
localClient.push(content_block.content.decode("utf-8"),
collection_names=localConfig["collections"],
content_binding=content_block.binding,
uri=localInbox)
except Exception as ex:
log.error("FAILED TO PUSH BLOCK!")
log.error("%s", content_block)
log.exception(ex, exc_info=True)
except Exception as ex:
log.error("FAILED TO POLL %s", collection)
log.exception(ex, exc_info=True)
log.info("Finished!")