Getting notified of Rails errors like the default message claims.
In production, rails3 by default says:
We’re sorry, but something went wrong.
We’ve been notified about this issue and we’ll take a look at it shortly.
Oddly by default it does nothing to “notify” you about the issue (and it certainly does nothing to “take a look at it shortly” ;-)), unless you count logging some data to a log file. This is actually pretty misleading, and I’ve had some customers tell me “I got a problem message that said you were aware of the problem” – I wasn’t aware of it, but could dig it up in the log file.
Enter exception_notifier.
Put:
gem 'exception_notification', :require => 'exception_notifier'
In your Gemfile, and:
config.middleware.use ExceptionNotifier,
:email_prefix => "[Exception] ",
:sender_address => %{"Exception Notifier" },
:exception_recipients => %w{you@me.com}
In your production.rb’s config block. Customise the addresses, and you’re done! Now you will actually be notified of exceptions. Useful…
Here’s a neat way to use exceptions to create custom error pages: http://stackoverflow.com/questions/2238244/custom-error-pages-in-rails/2281215#2281215
I also recommend updating the 500 and 404 error pages with some text that more accurately describes what you plan to do about these errors. You can find these pages under public/
