mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
Fix Bugsnag call to notify
Make sure we add metadata as expected: https://docs.bugsnag.com/platforms/ruby/rails/reporting-handled-errors/#add_metadata
This commit is contained in:
@@ -51,7 +51,7 @@ module OrderCompletion
|
||||
|
||||
def order_invalid!
|
||||
Bugsnag.notify("Notice: invalid order loaded during checkout") do |payload|
|
||||
payload.add_metadata :order, @order
|
||||
payload.add_metadata :order, :order, @order
|
||||
end
|
||||
|
||||
flash[:error] = t('checkout.order_not_loaded')
|
||||
|
||||
@@ -21,7 +21,7 @@ module OrderStockCheck
|
||||
return unless current_order_cycle&.closed?
|
||||
|
||||
Bugsnag.notify("Notice: order cycle closed during checkout completion") do |payload|
|
||||
payload.add_metadata :order, current_order
|
||||
payload.add_metadata :order, :order, current_order
|
||||
end
|
||||
current_order.empty!
|
||||
current_order.set_order_cycle! nil
|
||||
|
||||
@@ -7,7 +7,7 @@ class ErrorsController < ApplicationController
|
||||
Bugsnag.notify("404") do |event|
|
||||
event.severity = "info"
|
||||
|
||||
event.add_metadata(:request, request.env)
|
||||
event.add_metadata(:request, :request, request.env)
|
||||
end
|
||||
render status: :not_found, formats: :html
|
||||
end
|
||||
|
||||
@@ -214,10 +214,10 @@ module Spree
|
||||
|
||||
def notify_bugsnag(error, product, variant)
|
||||
Bugsnag.notify(error) do |report|
|
||||
report.add_metadata(:product, product.attributes)
|
||||
report.add_metadata(:product_error, product.errors.first) unless product.valid?
|
||||
report.add_metadata(:variant, variant.attributes)
|
||||
report.add_metadata(:variant_error, variant.errors.first) unless variant.valid?
|
||||
report.add_metadata(:product,
|
||||
{ product: product.attributes, variant: variant.attributes })
|
||||
report.add_metadata(:product, :product_error, product.errors.first) unless product.valid?
|
||||
report.add_metadata(:product, :variant_error, variant.errors.first) unless variant.valid?
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user