Skip to content

Commit

Permalink
handle undefined job_id
Browse files Browse the repository at this point in the history
  • Loading branch information
waltjones committed Jan 2, 2024
1 parent 2dcaa5a commit ea734f7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/rollbar/plugins/active_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ def self.included(base)
arguments
end

Rollbar.error(exception,
:job => self.class.name,
:job_id => job_id,
:use_exception_level_filters => true,
:arguments => args)
job_data = {
:job => self.class.name,
:use_exception_level_filters => true,
:arguments => args
}

# job_id isn't present when this is a mailer class.
job_data[:job_id] = job_id if defined?(job_id)

Rollbar.error(exception, job_data)
raise exception
end
end
Expand Down

0 comments on commit ea734f7

Please sign in to comment.