diff --git a/CHANGELOG.md b/CHANGELOG.md index fd65ce9bb..291d088bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ Changelog ========= +* Set default Delayed Job error context to job class + | [#499](https://github.com/bugsnag/bugsnag-ruby/pull/499) + | [Mike Stewart](https://github.com/mike-stewart) + ## 6.9.0 (12 Nov 2018) ### Enhancements diff --git a/lib/bugsnag/middleware/delayed_job.rb b/lib/bugsnag/middleware/delayed_job.rb index 0476e1ef9..5539d6960 100644 --- a/lib/bugsnag/middleware/delayed_job.rb +++ b/lib/bugsnag/middleware/delayed_job.rb @@ -24,6 +24,7 @@ def call(report) job_data[:active_job] = job.payload_object.job_data if job.payload_object.respond_to?(:job_data) payload_data = construct_job_payload(job.payload_object) report.context = payload_data[:display_name] if payload_data.include?(:display_name) + report.context ||= payload_data[:class] if payload_data.include?(:class) job_data[:payload] = payload_data end