Skip to content

Record exceptions in Sentry only if Sentry class is defined

Reuben Pereira requested to merge rp/conditional-sentry into master

What does this MR do and why?

Describe in detail what your merge request does and why.

Content

  • Record exceptions in Sentry only if Sentry class is defined

The Sentry class is only defined when sentry-ruby gem is "required". And the sentry-ruby gem is only "required" when the SENTRY_DSN variable is defined. When Sentry is not defined, we should not attempt to capture exceptions in Sentry.

The other option is to always require the sentry-ruby gem, but if it is not going to be used, there is no point in requiring it.

Author Check-list

  • Has documentation been updated?
Edited by Reuben Pereira

Merge request reports