We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
if i want to explicitly send an exception to sentry that would otherwise be ignored because of Sentry.configuration.excluded_exceptions i can do this:
sentry
Sentry.configuration.excluded_exceptions
Sentry.capture_exception(ignored_exception, hint: { ignore_exclusions: true })
however, as far as i can tell this isn't possible if i'm using the rails error reporting interface.
it would be useful to expose this there.
i think it could be achieved the same way tags are handled here:
tags
https://github.com/getsentry/sentry-ruby/blob/master/sentry-rails/lib/sentry/rails/error_subscriber.rb#L17C38-L20
so you could just provide a hint key in context::
hint
context:
Rails.error.report exception, e, handled: true, severity: :error, context: { hint: { ignore_exclusions: true } }
and you could then pass it in via this (untested) implementation:
def report(error, handled:, severity:, context:, source: nil) tags = { handled: handled } if source return if SKIP_SOURCES.match?(source) tags[:source] = source end if context[:tags].is_a?(Hash) context = context.dup tags.merge!(context.delete(:tags)) end hint = {} if context[:hint].is_a?(Hash) context = context.dup hint.merge!(context.delete(:hint) end Sentry::Rails.capture_exception(error, level: severity, contexts: { "rails.error" => context }, tags: tags, hint: hint) end
The text was updated successfully, but these errors were encountered:
@modosc yep this makes sense to have, will add it when I have some time or feel free to PR!
Sorry, something went wrong.
@sl0thentr0py i opened #2235 - i just copied the code/spec pattern from the existing tags: implementation.
tags:
sl0thentr0py
Successfully merging a pull request may close this issue.
if i want to explicitly send an exception to
sentry
that would otherwise be ignored because ofSentry.configuration.excluded_exceptions
i can do this:however, as far as i can tell this isn't possible if i'm using the rails error reporting interface.
it would be useful to expose this there.
i think it could be achieved the same way
tags
are handled here:https://github.com/getsentry/sentry-ruby/blob/master/sentry-rails/lib/sentry/rails/error_subscriber.rb#L17C38-L20
so you could just provide a
hint
key incontext:
:and you could then pass it in via this (untested) implementation:
The text was updated successfully, but these errors were encountered: