From dcbfe8f792639041df302c346d0969c2c9ed7335 Mon Sep 17 00:00:00 2001 From: Eduard Melnyk Date: Wed, 9 Sep 2020 19:43:03 +0300 Subject: [PATCH] Publication 2.3.7 (#70) * Removed exceptions showed to enduser --- Controller/Payment/Fallback.php | 4 ++++ Model/Exception/AcquireLockException.php | 27 ++++++++++++++++++++++++ Model/TransactionProcessor.php | 5 ++++- composer.json | 2 +- 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 Model/Exception/AcquireLockException.php diff --git a/Controller/Payment/Fallback.php b/Controller/Payment/Fallback.php index 5e30b1cc..2d4a41a6 100755 --- a/Controller/Payment/Fallback.php +++ b/Controller/Payment/Fallback.php @@ -38,6 +38,7 @@ use Vipps\Payment\Api\QuoteRepositoryInterface; use Vipps\Payment\Gateway\Command\PaymentDetailsProvider; use Vipps\Payment\Gateway\Transaction\Transaction; +use Vipps\Payment\Model\Exception\AcquireLockException; use Vipps\Payment\Model\Gdpr\Compliance; use Vipps\Payment\Model\TransactionProcessor; use Vipps\Payment\Gateway\Exception\VippsException; @@ -153,6 +154,9 @@ public function execute() $this->logger->critical($this->enlargeMessage($e)); $this->messageManager->addErrorMessage($e->getMessage()); $resultRedirect->setPath('checkout/onepage/failure', ['_secure' => true]); + } catch (AcquireLockException $e) { + $this->logger->critical($e->getMessage()); + $resultRedirect->setPath('checkout/onepage/failure', ['_secure' => true]); } catch (\Exception $e) { $this->logger->critical($this->enlargeMessage($e)); $this->messageManager->addErrorMessage( diff --git a/Model/Exception/AcquireLockException.php b/Model/Exception/AcquireLockException.php new file mode 100644 index 00000000..7420fbd9 --- /dev/null +++ b/Model/Exception/AcquireLockException.php @@ -0,0 +1,27 @@ +lockManager->lock($lockName, 10)) { return $lockName; } - throw new \Exception(__('Can not acquire lock for order "%1"', $reservedOrderId)); //@codingStandardsIgnoreLine + throw new AcquireLockException(__('Can not acquire lock for order "%1"', $reservedOrderId)); //@codingStandardsIgnoreLine } /** diff --git a/composer.json b/composer.json index 07a77270..c596310b 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "magento2-module", "description": "Vipps Payment Method", "license": "proprietary", - "version": "2.3.6", + "version": "2.3.7", "require": { "magento/framework": "102.0.*", "magento/module-sales": "102.0.*",