mirror of
https://github.com/JonathanHerrewijnen/calibre-web.git
synced 2024-11-13 06:34:26 +00:00
Improved error logging for #1905
This commit is contained in:
parent
33bdc07f55
commit
f4ddac16f9
@ -169,8 +169,8 @@ class TaskEmail(CalibreTask):
|
|||||||
except (MemoryError) as e:
|
except (MemoryError) as e:
|
||||||
log.debug_or_exception(e)
|
log.debug_or_exception(e)
|
||||||
self._handleError(u'MemoryError sending email: ' + str(e))
|
self._handleError(u'MemoryError sending email: ' + str(e))
|
||||||
# return None
|
|
||||||
except (smtplib.SMTPException, smtplib.SMTPAuthenticationError) as e:
|
except (smtplib.SMTPException, smtplib.SMTPAuthenticationError) as e:
|
||||||
|
log.debug_or_exception(e)
|
||||||
if hasattr(e, "smtp_error"):
|
if hasattr(e, "smtp_error"):
|
||||||
text = e.smtp_error.decode('utf-8').replace("\n", '. ')
|
text = e.smtp_error.decode('utf-8').replace("\n", '. ')
|
||||||
elif hasattr(e, "message"):
|
elif hasattr(e, "message"):
|
||||||
@ -178,13 +178,11 @@ class TaskEmail(CalibreTask):
|
|||||||
elif hasattr(e, "args"):
|
elif hasattr(e, "args"):
|
||||||
text = '\n'.join(e.args)
|
text = '\n'.join(e.args)
|
||||||
else:
|
else:
|
||||||
log.debug_or_exception(e)
|
|
||||||
text = ''
|
text = ''
|
||||||
self._handleError(u'Smtplib Error sending email: ' + text)
|
self._handleError(u'Smtplib Error sending email: ' + text)
|
||||||
# return None
|
|
||||||
except (socket.error) as e:
|
except (socket.error) as e:
|
||||||
|
log.debug_or_exception(e)
|
||||||
self._handleError(u'Socket Error sending email: ' + e.strerror)
|
self._handleError(u'Socket Error sending email: ' + e.strerror)
|
||||||
# return None
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
Reference in New Issue
Block a user