From e05aa9bdc897e476b9bd408ce549dffab5ac6f4e Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 26 Jun 2014 09:58:37 +1000 Subject: [PATCH] Stop spamming mods even on exceptional cases --- app/jobs/scheduled/poll_mailbox.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/jobs/scheduled/poll_mailbox.rb b/app/jobs/scheduled/poll_mailbox.rb index 1ca26c95f68..01f210c4c99 100644 --- a/app/jobs/scheduled/poll_mailbox.rb +++ b/app/jobs/scheduled/poll_mailbox.rb @@ -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")}") Email::Sender.new(client_message, message_template).send else - Rails.logger.error e - - # 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) + data = { limit_once_per: false, message_params: { from: message.from, source: message.body } } + Discourse.handle_exception(e, data) end ensure mail.delete