feat(sentry-rails): Allow severity to pass what is available at level when using ActiveSupport::ErrorReporter#2637
Conversation
…vel` when using ActiveSupport::ErrorReporter The following are available for `level` in `sentry-rails`. - :fatal - :error - :warning - :log - :info - :debug cf. https://docs.sentry.io/platforms/ruby/guides/rails/usage/set-level/ But in the case of `severity` in ActiveSupport::ErrorReporter#report, ArgumentError is raised if anything other than the following is passed. - :error - :warning - :info cf. https://github.com/rails/rails/blob/v8.0.2/activesupport/lib/active_support/error_reporter.rb#L220-L222 cf. https://github.com/rails/rails/blob/v8.0.2/activesupport/lib/active_support/error_reporter.rb#L27 So I added symbols to ActiveSupport::ErrorReporter::SEVERITIES that is allowed as `level` when registering Sentry::Rails::ErrorSubscriber. It also supports the behavior that `warn` is considered as `warning`. cf. https://github.com/getsentry/sentry-ruby/blame/5.24.0/sentry-ruby/lib/sentry/event.rb#L100-L102
|
Thank you for the PR - one question though: how does it happen that you end up with the I need to understand better what the actual problem is. |
Thank you for the reply. The
|
|
OK but this means that it's outside of the SDK control, right? It's not the SDK that calls |
Description
The following are available for
levelinsentry-rails.cf. https://docs.sentry.io/platforms/ruby/guides/rails/usage/set-level/
But in the case of
severityin ActiveSupport::ErrorReporter#report, ArgumentError is raised if anything other than the following is passed.cf. https://github.com/rails/rails/blob/v8.0.2/activesupport/lib/active_support/error_reporter.rb#L220-L222
cf. https://github.com/rails/rails/blob/v8.0.2/activesupport/lib/active_support/error_reporter.rb#L27
So I added symbols to ActiveSupport::ErrorReporter::SEVERITIES that is allowed as
levelwhen registering Sentry::Rails::ErrorSubscriber.It also supports the behavior that
warnis considered aswarning.cf. https://github.com/getsentry/sentry-ruby/blob/5.24.0/sentry-ruby/lib/sentry/event.rb#L100-L102