Created
April 4, 2019 22:08
-
-
Save joshuap/5c0b3c6cb0bfb150cef3caf98cf9c6f6 to your computer and use it in GitHub Desktop.
Report correct controller name and action to Honeybadger w/ custom Rails exceptions app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Honeybadger.configure do |config| | |
config.before_notify do |notice| | |
# break out of our hook if component is not our errors controller | |
break if notice.component != 'errors' | |
# correct the component and action info based on the url | |
params = Rails.application.routes.recognize_path(notice.url) | |
# => {:controller=>"page", :action=>"index"} | |
notice.controller = params[:controller] | |
notice.action = params[:action] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See here: honeybadger-io/honeybadger-ruby#250 (comment)