Stop spamming mods even on exceptional cases

This commit is contained in:
Sam 2014-06-26 09:58:37 +10:00
parent 67804cb56b
commit e05aa9bdc8
1 changed files with 2 additions and 6 deletions

View File

@ -48,12 +48,8 @@ module Jobs
client_message = RejectionMailer.send_rejection(message.from, message.body, message_template.to_s, "#{e.message}\n\n#{e.backtrace.join("\n")}") client_message = RejectionMailer.send_rejection(message.from, message.body, message_template.to_s, "#{e.message}\n\n#{e.backtrace.join("\n")}")
Email::Sender.new(client_message, message_template).send Email::Sender.new(client_message, message_template).send
else else
Rails.logger.error e data = { limit_once_per: false, message_params: { from: message.from, source: message.body } }
Discourse.handle_exception(e, data)
# If not known type, inform admins about the error
# (Add to above case with a good error message!)
data = { limit_once_per: false, message_params: { from: message.from, source: message.body, error: "#{e.message}\n\n#{e.backtrace.join("\n")}" }}
GroupMessage.create(Group[:admins].name, :email_error_notification, data)
end end
ensure ensure
mail.delete mail.delete