Skip to content
New issue

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

RescuedExceptionInterceptor: Handle empty configuration #2428

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MrSerth
Copy link

@MrSerth MrSerth commented Oct 10, 2024

Previously, it could happen that Sentry.configuration was nil. In this case, calling rails would produce a NoMethodError. We fix this issue by using safe navigation.

Furthermore, this commit ensures we use a reasonable default in case the configuration couldn't be loaded. Since the config report_rescued_exceptions defaults to true, we assume this value here, too.

Fixes #2386

Previously, it could happen that `Sentry.configuration` was `nil`.
In this case, calling `rails` would produce a `NoMethodError`.
We fix this issue by using safe navigation.

Furthermore, this commit ensures we use a reasonable default
in case the configuration couldn't be loaded. Since the config
`report_rescued_exceptions` defaults to `true`, we assume
this value here, too.
 
Fixes getsentry#2386
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NoMethodError: undefined method rails for nil
1 participant