From dffeb970bc6bd0c981a1d08ea9bb4513615f0087 Mon Sep 17 00:00:00 2001 From: Vlad Carstea Date: Thu, 5 Jan 2023 12:15:34 +0200 Subject: [PATCH] catching and throwing guzzle client exceptions --- .../Api/MerchantFulfillmentApi/MerchantFulfillmentSDK.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/AmazonPHP/SellingPartner/Api/MerchantFulfillmentApi/MerchantFulfillmentSDK.php b/src/AmazonPHP/SellingPartner/Api/MerchantFulfillmentApi/MerchantFulfillmentSDK.php index 16001f924..2d90b0588 100644 --- a/src/AmazonPHP/SellingPartner/Api/MerchantFulfillmentApi/MerchantFulfillmentSDK.php +++ b/src/AmazonPHP/SellingPartner/Api/MerchantFulfillmentApi/MerchantFulfillmentSDK.php @@ -2,6 +2,7 @@ namespace Plenty\AmazonPHP\SellingPartner\Api\MerchantFulfillmentApi; +use GuzzleHttp\Exception\ClientException; use Plenty\AmazonPHP\SellingPartner\AccessToken; use Plenty\AmazonPHP\SellingPartner\Configuration; use Plenty\AmazonPHP\SellingPartner\Exception\ApiException; @@ -517,6 +518,8 @@ public function createShipment(AccessToken $accessToken, string $region, \Plenty ] ); } + } catch(ClientException $e) { + throw $e; } catch (ClientExceptionInterface $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}", @@ -1452,6 +1455,8 @@ public function getShipment(AccessToken $accessToken, string $region, string $sh ] ); } + } catch(ClientException $e) { + throw $e; } catch (ClientExceptionInterface $e) { throw new ApiException( "[{$e->getCode()}] {$e->getMessage()}",