Skip to content

Instantly share code, notes, and snippets.

@rob-mcgrail
Last active January 14, 2016 02:02
Show Gist options
  • Save rob-mcgrail/1fd939a057f23a16a7e0 to your computer and use it in GitHub Desktop.
Save rob-mcgrail/1fd939a057f23a16a7e0 to your computer and use it in GitHub Desktop.
Airbrake config
# https://github.com/airbrake/airbrake-ruby#configuration
Airbrake.configure do |c|
# You must set both project_id & project_key. To find your project_id and
# project_key navigate to your project's General Settings and copy the values
# from the right sidebar.
# https://github.com/airbrake/airbrake-ruby#project_id--project_key
c.project_id = 'xxxx'
c.project_key = 'xxxxxxxxxxx'
c.root_directory = Rails.root
c.logger = Rails.logger
c.environment = Rails.env
c.ignore_environments = %w(test development)
end
Airbrake.add_filter do |notice|
if notice[:errors].any? { |error| error[:type] == 'CanCan::AccessDenied' }
notice.ignore!
end
end
Airbrake.add_filter do |notice|
if notice[:errors].any? { |error| error[:type] == 'ActionController::RoutingError' }
notice.ignore!
end
end
Airbrake.add_filter do |notice|
if notice[:params]['retry_count'].present?
unless notice[:params]['retry_count'] == 0
notice.ignore!
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment