diff --git a/app/jobs/products_cache_integrity_checker_job.rb b/app/jobs/products_cache_integrity_checker_job.rb index 78feb3a1b0..8861b5a5a9 100644 --- a/app/jobs/products_cache_integrity_checker_job.rb +++ b/app/jobs/products_cache_integrity_checker_job.rb @@ -3,7 +3,14 @@ require 'open_food_network/products_cache_integrity_checker' ProductsCacheIntegrityCheckerJob = Struct.new(:distributor_id, :order_cycle_id) do def perform unless checker.ok? - Bugsnag.notify RuntimeError.new("Products JSON differs from cached version for distributor: #{distributor_id}, order cycle: #{order_cycle_id}"), diff: checker.diff.to_s(:text) + exception = RuntimeError.new( + "Products JSON differs from cached version for distributor: #{distributor_id}, " \ + "order cycle: #{order_cycle_id}" + ) + + Bugsnag.notify(exception) do |report| + report.add_tab(:products_cache, diff: checker.diff.to_s(:text)) + end end end