Stop spamming mods even on exceptional cases
This commit is contained in:
parent
67804cb56b
commit
e05aa9bdc8
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue