better exception logging

This commit is contained in:
jonaswinkler
2021-02-11 22:16:41 +01:00
parent b90a5f625a
commit 555e37958f
5 changed files with 9 additions and 14 deletions

View File

@@ -13,11 +13,8 @@ def process_mail_accounts():
try:
total_new_documents += MailAccountHandler().handle_mail_account(
account)
except MailError as e:
logger.error(
f"Error while processing mail account {account}: {e}",
exc_info=True
)
except MailError:
logger.exception(f"Error while processing mail account {account}")
if total_new_documents > 0:
return f"Added {total_new_documents} document(s)."