Skip to content

Commit

Permalink
Report ActiveRecord::RecordNotFound errors to Sentry (#1943)
Browse files Browse the repository at this point in the history
these errors are excluded by default with sentry-ruby

Fixes #1942

---------

Co-authored-by: Robert Schäfer <git@roschaefer.de>
  • Loading branch information
mattwr18 and roschaefer authored Jul 23, 2024
1 parent 9869428 commit a1ed5a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion config/initializers/sentry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
config.breadcrumbs_logger = [:active_support_logger]
config.capture_exception_frame_locals = true
config.server_name = ENV['APPLICATION_HOSTNAME'] if ENV['APPLICATION_HOSTNAME'].present?
config.excluded_exceptions += ['ErrorNotifier::IgnoredError']
unignored_exceptions = ['ActiveRecord::RecordNotFound']
ignored_exceptions = ['ErrorNotifier::IgnoredError']

config.excluded_exceptions -= unignored_exceptions
config.excluded_exceptions += ignored_exceptions
end

0 comments on commit a1ed5a0

Please sign in to comment.