Log backtrace when we get mystery meat errors in e-mail processing

This commit is contained in:
Matt Palmer 2016-07-02 15:03:13 +10:00
parent 0c6d8e155c
commit 22bbc3ea73
1 changed files with 5 additions and 1 deletions

View File

@ -79,7 +79,11 @@ module Email
Email::Sender.new(client_message, message_template).send
end
else
Rails.logger.error("Unrecognized error type (#{e}) when processing incoming email\n\nMail:\n#{mail_string}")
msg = "Unrecognized error type (#{e.class}: #{e.message}) when processing incoming email"
msg += "\n\nBacktrace:\n#{e.backtrace.map { |l| " #{l}" }.join("\n")}"
msg += "\n\nMail:\n#{mail_string}"
Rails.logger.error(msg)
end
client_message