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

fix: don't raise an exception when ActiveJob isn't loaded #523

Merged
merged 2 commits into from
Feb 26, 2024

Conversation

stympy
Copy link
Member

@stympy stympy commented Feb 26, 2024

If ActiveJob isn't loaded (by not requiring active_job/railtie in config/application.rb), then this error occur when Honeybadger is loaded:

plugin error name=active_job class=NoMethodError message="undefined method `active_job' for an instance of Rails::Application::Configuration"

This change rescues that error and disables the plugin.

If ActiveJob isn't loaded (by not requiring active_job/railtie in config/application.rb),
then this error occur when Honeybadger is loaded:

plugin error name=active_job class=NoMethodError message="undefined method `active_job' for an instance of Rails::Application::Configuration"

This change rescues that error and disables the plugin.
@stympy stympy requested a review from joshuap February 26, 2024 14:51
Check for method with `respond_to?` instead of raising exception
@joshuap joshuap changed the title fix: Avoid raising an error when ActiveJob isn't loaded fix: don't raise an exception when ActiveJob isn't loaded Feb 26, 2024
Copy link
Member

@joshuap joshuap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I changed it to check if the method exists instead of raising an exception.

@joshuap joshuap merged commit 40c7892 into master Feb 26, 2024
59 of 60 checks passed
@stympy stympy deleted the rescue-active-job branch July 11, 2024 15:51
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.

2 participants