Skip to content

Commit

Permalink
Include claim reference in rollbar errors
Browse files Browse the repository at this point in the history
When a job errors we want to be able to easily identify which claim it
was working with, if there is one.
  • Loading branch information
rjlynch committed Dec 27, 2024
1 parent 2cd7f30 commit d327c21
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/jobs/application_job.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
class ApplicationJob < ActiveJob::Base
around_perform do |job, block|
claim = job.arguments.find { |arg| arg.is_a?(Claim) }

if claim
Rollbar.scope!(claim: {reference: claim.reference})
end

block.call
end

def priority
10
end
Expand Down

0 comments on commit d327c21

Please sign in to comment.