* Rubocop enabled style/alias * Enabled Style/ArrayJoin Cop * Enabled Style/Attr * Enabled Case Equality * Enabled CharacterLiteral * Enabled ColonMethodCall Cop * Enabled CommentAnnotation cop * Enabled PreferredHashMethods Cop * Enabled DoubleNegation Cop * Enabled EachWithObject Cop * Enabled EmptyLiteral Cop * Enabled EvenOdd Cop * Enabled IfWithSemicolon Cop * Enabled Lambda and LambdaCall Cop * Enabled LineEndConcatenation Cop * Enabled ModuleFunction Cop; * Enable NegatedIf and NegatedWhile Cop * Enabled NilComparison Cop * Enabled Not Cop * Enabled NumericLiterals Cop * Enabled OneLineConditional Cop * Enabled PercentLiteralDelimiters Cop * Excluded internal/users_controller from negated_if cop * Reverted the double negation change from github_issue_tag and github_issue.rb" * Enabled PerlBackrefs Cop * Changed Regexp.last_match(1) to Regexp.last_match(0) * Enabled proc cop * Enabled RaiseArgs Cop * Reverted Regexp.last_match(0) to Regexp.last_match(1) * Enabled SelfAssignment Cop * Enabled SingleLineMethods Cop * Enabled SpecialGlobalVars Cop * Enabled VariableInterpolation Cop * Enabled WhenThen Cop * Enabled WhileUntilModifier Cop * Enabled WordArray Cop * Enabled IfUnlessModifier Cop * Enabled GuardClause Cop
60 lines
2.8 KiB
Ruby
60 lines
2.8 KiB
Ruby
# Airbrake is an online tool that provides robust exception tracking in your Rails
|
|
# applications. In doing so, it allows you to easily review errors, tie an error
|
|
# to an individual piece of code, and trace the cause back to recent
|
|
# changes. Airbrake enables for easy categorization, searching, and prioritization
|
|
# of exceptions so that when errors occur, your team can quickly determine the
|
|
# root cause.
|
|
#
|
|
# Configuration details:
|
|
# 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 = ApplicationConfig["AIRBRAKE_PROJECT_ID"]
|
|
c.project_key = ApplicationConfig["AIRBRAKE_API_KEY"]
|
|
|
|
# Configures the root directory of your project. Expects a String or a
|
|
# Pathname, which represents the path to your project. Providing this option
|
|
# helps us to filter out repetitive data from backtrace frames and link to
|
|
# GitHub files from our dashboard.
|
|
# https://github.com/airbrake/airbrake-ruby#root_directory
|
|
c.root_directory = Rails.root
|
|
|
|
# By default, Airbrake Ruby outputs to STDOUT. In Rails apps it makes sense to
|
|
# use the Rails' logger.
|
|
# https://github.com/airbrake/airbrake-ruby#logger
|
|
c.logger = Rails.logger
|
|
|
|
# Configures the environment the application is running in. Helps the Airbrake
|
|
# dashboard to distinguish between exceptions occurring in different
|
|
# environments. By default, it's not set.
|
|
# NOTE: This option must be set in order to make the 'ignore_environments'
|
|
# option work.
|
|
# https://github.com/airbrake/airbrake-ruby#environment
|
|
c.environment = Rails.env
|
|
|
|
# Setting this option allows Airbrake to filter exceptions occurring in
|
|
# unwanted environments such as :test. By default, it is equal to an empty
|
|
# Array, which means Airbrake Ruby sends exceptions occurring in all
|
|
# environments.
|
|
# NOTE: This option *does not* work if you don't set the 'environment' option.
|
|
# https://github.com/airbrake/airbrake-ruby#ignore_environments
|
|
c.ignore_environments = %w[test development]
|
|
|
|
# A list of parameters that should be filtered out of what is sent to
|
|
# Airbrake. By default, all "password" attributes will have their contents
|
|
# replaced.
|
|
# https://github.com/airbrake/airbrake-ruby#blacklist_keys
|
|
c.blacklist_keys = [/password/i]
|
|
end
|
|
|
|
# If Airbrake doesn't send any expected exceptions, we suggest to uncomment the
|
|
# line below. It might simplify debugging of background Airbrake workers, which
|
|
# can silently die.
|
|
# Thread.abort_on_exception = ['test', 'development'].include?(Rails.env)
|
|
|
|
Airbrake.add_filter do |notice|
|
|
notice.ignore! if notice[:errors].any? { |error| error[:type] == "Pundit::NotAuthorizedError" }
|
|
end
|