Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unneeded should_capture code #1444

Merged
merged 1 commit into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ GEM
factory_bot_rails (6.1.0)
factory_bot (~> 6.1.0)
railties (>= 5.0.0)
faraday (1.0.1)
faraday (1.1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords
ffi (1.13.1)
fugit (1.3.6)
et-orbi (~> 1.1, >= 1.1.8)
Expand All @@ -123,9 +124,9 @@ GEM
warden-oauth2 (~> 0.0.1)
globalid (0.4.2)
activesupport (>= 4.2.0)
govuk_app_config (2.4.0)
govuk_app_config (2.5.0)
logstasher (>= 1.2.2, < 1.4.0)
sentry-raven (>= 2.7.1, < 3.1.0)
sentry-raven (~> 3.1.1)
statsd-ruby (~> 1.4.0)
unicorn (>= 5.4, < 5.8)
govuk_document_types (0.9.2)
Expand Down Expand Up @@ -307,10 +308,11 @@ GEM
rubocop-rspec (1.42.0)
rubocop (>= 0.87.0)
ruby-progressbar (1.10.1)
ruby2_keywords (0.0.2)
rufus-scheduler (3.6.0)
fugit (~> 1.1, >= 1.1.6)
safe_yaml (1.0.5)
sentry-raven (3.0.4)
sentry-raven (3.1.1)
faraday (>= 1.0)
sidekiq (5.2.9)
connection_pool (~> 2.2, >= 2.2.2)
Expand Down
16 changes: 0 additions & 16 deletions config/initializers/govuk_error.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
GovukError.configure do |config|
config.excluded_exceptions << "DeliveryRequestWorker::ProviderCommunicationFailureError"

# Don't capture postgres errors that occur during the time that the data sync
# is running in integration and staging environments
# This lambda is called with Ruby Exception objects, Raven::Event objects
# and may be called with other types.
config.should_capture = lambda do |error_or_event|
data_sync_ignored_error = error_or_event.is_a?(PG::Error) ||
(error_or_event.respond_to?(:cause) && error_or_event.cause.is_a?(PG::Error))

data_sync_environment = ENV.fetch("SENTRY_CURRENT_ENV", "")
.match(/integration|staging/)

data_sync_time = Time.zone.now.hour <= 8

!(data_sync_ignored_error && data_sync_environment && data_sync_time)
end
end