mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-03 06:59:14 +00:00
Rescue errors in report generation
So we can report them to Bugsnag and the job isn't marked as failed and therefore won't repeat.
This commit is contained in:
@@ -21,6 +21,12 @@ class ReportJob < ApplicationJob
|
||||
email_result(user, blob) if execution_time > NOTIFICATION_TIME
|
||||
|
||||
broadcast_result(channel, format, blob) if channel
|
||||
rescue StandardError => e
|
||||
Bugsnag.notify(e) do |payload|
|
||||
payload.add_metadata :report, {
|
||||
report_class:, user:, params:, format:
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def email_result(user, blob)
|
||||
|
||||
Reference in New Issue
Block a user