From a635a03065e82894ebbbc85810801d93440e4cfb Mon Sep 17 00:00:00 2001 From: Kevin Dew Date: Wed, 18 Mar 2020 18:18:42 +0000 Subject: [PATCH 1/2] Exclude ActiveRecord rescue responses In updating the default Rails ones I failed to realise that some were configured in ActionDispatch [1] and others were in ActiveRecord [2] so the last iteration of this missed all of these. [1]: https://github.com/rails/rails/blob/eed9f15ba87d4d4c9be48119e55e8ff17102c4a7/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb#L8-L24 [2]: https://github.com/rails/rails/blob/eed9f15ba87d4d4c9be48119e55e8ff17102c4a7/activerecord/lib/active_record/railtie.rb#L22-L27 --- CHANGELOG.md | 6 +++++- lib/govuk_app_config/configure.rb | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbad65c4..e50cd66a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ +# Unreleased + +* Add missing ActiveRecord rescue_responses (https://github.com/alphagov/govuk_app_config/pull/142) + # 2.1.1 -* Revert using Sentry option of rails_report_rescued_exceptions (https://github.com/alphagov/govuk_app_config/pull/140) +* revert using sentry option of rails_report_rescued_exceptions (https://github.com/alphagov/govuk_app_config/pull/140) # 2.1.0 diff --git a/lib/govuk_app_config/configure.rb b/lib/govuk_app_config/configure.rb index 261691b8..42332315 100644 --- a/lib/govuk_app_config/configure.rb +++ b/lib/govuk_app_config/configure.rb @@ -8,7 +8,7 @@ config.silence_ready = !Rails.env.production? if defined?(Rails) config.excluded_exceptions = [ - # default Rails rescue responses + # Default ActionDispatch rescue responses "ActionController::RoutingError", "AbstractController::ActionNotFound", "ActionController::MethodNotAllowed", @@ -24,7 +24,12 @@ "ActionController::ParameterMissing", "Rack::QueryParser::ParameterTypeError", "Rack::QueryParser::InvalidParameterError", - # additional items + # Default ActiveRecord rescue responses + "ActiveRecord::RecordNotFound", + "ActiveRecord::StaleObjectError", + "ActiveRecord::RecordInvalid", + "ActiveRecord::RecordNotSaved", + # Additional items "ActiveJob::DeserializationError", "CGI::Session::CookieStore::TamperedWithCookie", "GdsApi::HTTPIntermittentServerError", From fe0f46061c607f4c4db2c989e5df4fa6524d1eb9 Mon Sep 17 00:00:00 2001 From: Kevin Dew Date: Wed, 18 Mar 2020 18:27:51 +0000 Subject: [PATCH 2/2] Fix capitalisation in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e50cd66a..090baaaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ # 2.1.1 -* revert using sentry option of rails_report_rescued_exceptions (https://github.com/alphagov/govuk_app_config/pull/140) +* Revert using sentry option of rails_report_rescued_exceptions (https://github.com/alphagov/govuk_app_config/pull/140) # 2.1.0