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