Skip to content

Commit

Permalink
fix: don't blow up if ActiveJob queue_adapter isn't a string or symbol (
Browse files Browse the repository at this point in the history
#561)

Fixes #560
  • Loading branch information
stympy authored Jun 12, 2024
1 parent ec4b8aa commit 4550ea3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/honeybadger/plugins/active_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ def context(job) # rubocop:disable Metrics/MethodLength
requirement do
defined?(::Rails.application) &&
::Rails.application.config.respond_to?(:active_job) &&
::Rails.application.config.active_job[:queue_adapter].respond_to?(:to_sym) &&
!EXCLUDED_ADAPTERS.include?(::Rails.application.config.active_job[:queue_adapter].to_sym)
end

# Don't report errors if GoodJob is reporting them
requirement do
::Rails.application.config.active_job[:queue_adapter].to_sym != :good_job ||
!::Rails.application.config.active_job[:queue_adapter].to_s.match?(/(GoodJob::Adapter|good_job)/) ||
!::Rails.application.config.respond_to?(:good_job) ||
::Rails.application.config.good_job[:on_thread_error].nil?
end
Expand Down

0 comments on commit 4550ea3

Please sign in to comment.