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 286195c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/jobs/application_job.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
class ApplicationJob < ActiveJob::Base
around_perform do |job, block|
claim = job.arguments.find { |arg| arg.is_a?(Claim) }

if claim
Rollbar.scoped(claim_reference: claim.reference) do
block.call
end
else
block.call
end
end

def priority
10
end
Expand Down

0 comments on commit 286195c

Please sign in to comment.