From f4ddac16f9ea6acd719306fa81e725677bdbdbac Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 21 Mar 2021 11:58:51 +0100 Subject: [PATCH] Improved error logging for #1905 --- cps/tasks/mail.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cps/tasks/mail.py b/cps/tasks/mail.py index 4f7ed777..4d0b2f77 100644 --- a/cps/tasks/mail.py +++ b/cps/tasks/mail.py @@ -169,8 +169,8 @@ class TaskEmail(CalibreTask): except (MemoryError) as e: log.debug_or_exception(e) self._handleError(u'MemoryError sending email: ' + str(e)) - # return None except (smtplib.SMTPException, smtplib.SMTPAuthenticationError) as e: + log.debug_or_exception(e) if hasattr(e, "smtp_error"): text = e.smtp_error.decode('utf-8').replace("\n", '. ') elif hasattr(e, "message"): @@ -178,13 +178,11 @@ class TaskEmail(CalibreTask): elif hasattr(e, "args"): text = '\n'.join(e.args) else: - log.debug_or_exception(e) text = '' self._handleError(u'Smtplib Error sending email: ' + text) - # return None except (socket.error) as e: + log.debug_or_exception(e) self._handleError(u'Socket Error sending email: ' + e.strerror) - # return None @property