Skip to content

Commit

Permalink
Merge pull request #138 from alphagov/do-not-report-exceptions-rescue…
Browse files Browse the repository at this point in the history
…d-by-ActionDispatch

Do not report exceptions rescued by rails
  • Loading branch information
AlanGabbianelli authored Mar 9, 2020
2 parents 6c050a5 + 8f25109 commit 18dc1ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased

* Stop exceptions rescued by rails from appearing in Sentry (/~https://github.com/alphagov/govuk_app_config/pull/138)

# 2.0.3

* Add hmrc-uk.digital.nuance.com (Nuance/HMRC Webchat provider) and gov.klick2contact.com (HMPO web chat provider) to connect-src CSP list (/~https://github.com/alphagov/govuk_app_config/pull/133)
Expand Down
11 changes: 4 additions & 7 deletions lib/govuk_app_config/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@
config.silence_ready = !Rails.env.production? if defined?(Rails)

config.excluded_exceptions = [
'AbstractController::ActionNotFound',
'ActionController::BadRequest',
'ActionController::InvalidAuthenticityToken',
'ActionController::ParameterMissing',
'ActionController::RoutingError',
'ActionController::UnknownAction',
'ActionController::UnknownHttpMethod',
'ActionDispatch::RemoteIp::IpSpoofAttackError',
'ActiveJob::DeserializationError',
'ActiveRecord::RecordNotFound',
'CGI::Session::CookieStore::TamperedWithCookie',
'GdsApi::HTTPIntermittentServerError',
'GdsApi::TimedOutException',
Expand All @@ -33,4 +26,8 @@
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

0 comments on commit 18dc1ae

Please sign in to comment.