Use next to return out of `before_send`

This commit is contained in:
Karina Kwiatek 2023-01-28 22:29:41 +01:00
parent 272b98c954
commit 354407cd79
1 changed files with 2 additions and 4 deletions

View File

@ -14,10 +14,8 @@ Sentry.init do |config|
Twitter::Error::InternalServerError => 'external-service',
}
config.before_send = lambda do |event, hint|
if hint[:exception].is_a?(Errors::Base)
# These are used for user-facing errors, not when something goes wrong
nil
end
# These are used for user-facing errors, not when something goes wrong
next if hint[:exception].is_a?(Errors::Base)
exception_class = hint[:exception].class.name
if exception_fingerprints.key?(exception_class)