Sha256: e152143b72d826166d627a6d99091f1fdb3cf255b5e5a20510b0e8765e0c66ca

Contents?: true

Size: 1.03 KB

Versions: 7

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

project_id = ENV['AIR_BRAKE_PROJECT_ID']
project_key = ENV['AIR_BRAKE_PROJECT_KEY']

AIRBRAKE_ENABLED = project_id.present? && project_key.present?

if AIRBRAKE_ENABLED
  require 'airbrake'

  Airbrake.configure do |c|
    c.project_id = project_id
    c.project_key = project_key

    c.root_directory = Rails.root
    c.logger = Rails.logger
    c.environment = Rails.env
    c.blacklist_keys = Rails.application.config.filter_parameters

    c.ignore_environments = %w(test)

    c.performance_stats = true
  end

  ignore_errors = %w(
    AbstractController::ActionNotFound
    ActiveRecord::RecordNotFound
    SignalException
  )

  Airbrake.add_filter do |notice|
    notice.ignore! if notice[:errors].any? { |error| ignore_errors.include?(error[:type]) }
  end
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)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lcms-engine-0.3.1 config/initializers/airbrake.rb
lcms-engine-0.1.4 config/initializers/airbrake.rb
lcms-engine-0.3.0 config/initializers/airbrake.rb
lcms-engine-0.1.3 config/initializers/airbrake.rb
lcms-engine-0.2.0 config/initializers/airbrake.rb
lcms-engine-0.1.2 config/initializers/airbrake.rb
lcms-engine-0.1.0 config/initializers/airbrake.rb