You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ExceptionNotifier works OK as long as you don't have to manually
call the `Notifier#exception_notification` method yourself and
rely on the middleware to do your job.
However, if you are using a Rails action to show 500 errors (e.g.
you are using the `rescue_from` helper in your
ApplicationController), then you will have to reconfigure the
ExceptionNotifier options.
This means that in your controller you'd have something like:
rescue_from Exception, :with => :server_error
def server_error(exception)
request.env['exception_notifier.options'] = {
:sender_address => "[email protected]",
:exception_recipients => "[email protected]"
}
ExceptionNotifier::Notifier.exception_notification(
request.env, exception
).deliver
end
... which means code duplication, especially if you have more
than one action that's handling exceptions.
This commit should solve this problem by making the default
attributes writable and use the initial middleware configuration
to set those defaults to something more sensible.
0 commit comments