Make sure to log a proper exception when an email error occurs

This commit is contained in:
Joseph Schorr 2014-11-03 17:16:36 -05:00
parent 6dfdb2fe03
commit 8bffbde4ae

View file

@ -41,6 +41,7 @@ def send_email(recipient, subject, template_file, parameters):
try:
mail.send(msg)
except Exception as ex:
logger.exception('Error while trying to send email to %s', recipient)
raise CannotSendEmailException(ex.message)
def send_password_changed(username, email):