Fix opds and error logging in mail

This commit is contained in:
Ozzie Isaacs
2021-03-21 11:54:39 +01:00
parent 59ebc1af8a
commit 130a4ed2d3
4 changed files with 8 additions and 6 deletions

View File

@@ -172,6 +172,7 @@ class TaskEmail(CalibreTask):
log.debug_or_exception(e)
self._handleError(u'MemoryError sending email: ' + str(e))
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"):
@@ -179,10 +180,10 @@ 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)
except (socket.error) as e:
log.debug_or_exception(e)
self._handleError(u'Socket Error sending email: ' + e.strerror)