Sha256: 5da46d736557a6697418c2289c206c63d69ea44257d534cce40f406fe7a2ae4b

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

GovukError.configure do |config|
  config.before_send = Proc.new { |e|
    GovukStatsd.increment("errors_occurred")
    GovukStatsd.increment("error_types.#{e.class.name.demodulize.underscore}")
    e
  }

  config.silence_ready = !Rails.env.production? if defined?(Rails)

  config.excluded_exceptions = [
    'ActionController::UnknownAction',
    'ActionDispatch::RemoteIp::IpSpoofAttackError',
    'ActiveJob::DeserializationError',
    'CGI::Session::CookieStore::TamperedWithCookie',
    'GdsApi::HTTPIntermittentServerError',
    'GdsApi::TimedOutException',
    'Mongoid::Errors::DocumentNotFound',
    'Sinatra::NotFound',
  ]

  # This will exclude exceptions that are triggered by one of the ignored
  # exceptions. For example, when any exception occurs in a template,
  # Rails will raise a ActionView::Template::Error, instead of the original error.
  config.inspect_exception_causes_for_exclusion = true

  config.transport_failure_callback = Proc.new {
    GovukStatsd.increment("error_reports_failed")
  }

  # This stops exceptions rescued by rails from appearing in Sentry.
  # See https://www.rubydoc.info/gems/sentry-raven/1.2.2/Raven%2FConfiguration:rails_report_rescued_exceptions
  config.rails_report_rescued_exceptions = false
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
govuk_app_config-2.1.0 lib/govuk_app_config/configure.rb