From da4abf66179618ced45abbe4c8f3724d5d5bc23e Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Wed, 29 Jul 2020 21:57:55 +0100 Subject: [PATCH] Add a comment to explain the necessity of the first rescue in the update action --- app/controllers/checkout_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/checkout_controller.rb b/app/controllers/checkout_controller.rb index b801213e09..479d740581 100644 --- a/app/controllers/checkout_controller.rb +++ b/app/controllers/checkout_controller.rb @@ -51,6 +51,8 @@ class CheckoutController < Spree::StoreController checkout_workflow(params_adapter.shipping_method_id) rescue Spree::Core::GatewayError => e + # This rescue is not replaceable by the generic rescue_from above because otherwise the rescue + # below (StandardError) would catch the GatewayError and report it as a generic error rescue_from_spree_gateway_error(e) rescue StandardError => e flash[:error] = I18n.t("checkout.failed")