Ok, so the problem was that apparently previous devs (I inherited this project) had already set up a different kind of error catching that simply rendered different error pages. That function only ran in production, and it was blocking the call to exception_notification, which is why it just wasn't doing anything in production, but was working fine in development. So... all I did in the end was this...
In the app... this was already in the controllers/application_controller.rb file:
unless Rails.application.config.consider_all_requests_local
#Commenting this would show user a blank page but also show a detailed error message. Don't do this
#Unless absolutely necessary.
rescue_from Exception, with: lambda { |exception| render_error 500, exception }
rescue_from ActionController::RoutingError, ActionController::UnknownController, AbstractController::ActionNotFound, ActiveRecord::RecordNotFound, with: lambda { |exception| render_error 404, exception }
end
And the render_error function had some just well, rendered the error page. So I added in a step to set off the call to exception_notification like so...
def render_error(status, exception)
if (status != 404)
ExceptionNotifier::Notifier
.exception_notification(exception, options.merge(:env => env))
.deliver
end
respond_to do |format|
format.html { render template: "home/error_#{status}", layout: 'layouts/heropage', status: status }
format.all { render nothing: true, status: status }
end
end