Merge pull request #1510 from martenson/log-user-exceptions-properly

[16.01] catch Exception and properly log errors
This commit is contained in:
Martin Cech
2016-01-14 12:57:23 -05:00
@@ -788,7 +788,8 @@ class User( BaseUIController, UsesFormDefinitionsMixin, CreatesUsersMixin, Creat
subject = 'Join Mailing List'
try:
util.send_mail( frm, to, subject, body, trans.app.config )
except:
except Exception:
log.exception( 'Subscribing to the mailing list has failed.' )
error = "Now logged in as " + user.email + ". However, subscribing to the mailing list has failed."
if not error and not is_admin:
# The handle_user_login() method has a call to the history_set_default_permissions() method
@@ -847,7 +848,8 @@ class User( BaseUIController, UsesFormDefinitionsMixin, CreatesUsersMixin, Creat
try:
util.send_mail( frm, to, subject, body, trans.app.config )
return True
except:
except Exception:
log.exception( 'Unable to send the activation email.' )
return False
def prepare_activation_link( self, trans, email ):