mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-11 23:17:48 +00:00
Notify BugSnag when something unexpected happens
This commit is contained in:
@@ -60,6 +60,7 @@ module Spree
|
||||
end
|
||||
rescue StandardError => e
|
||||
logger.error e.message
|
||||
Bugsnag.notify(e)
|
||||
flash[:error] = e.message
|
||||
ensure
|
||||
redirect_to request.referer
|
||||
|
||||
@@ -111,6 +111,7 @@ describe Spree::Admin::PaymentsController, type: :request do
|
||||
# The redirect_do also calls Rails.logger.error
|
||||
expect(Rails.logger).to receive(:error).with("Unexpected !").ordered
|
||||
expect(Rails.logger).to receive(:error).with(/Redirected/).ordered
|
||||
expect(Bugsnag).to receive(:notify).with(StandardError)
|
||||
|
||||
put(
|
||||
"/admin/orders/#{order.number}/payments/#{order.payments.first.id}/fire?e=void",
|
||||
|
||||
Reference in New Issue
Block a user