Skip to content

Commit

Permalink
Merge pull request #15 from plentymarkets/fulfi/39777-throw-guzzle-cl…
Browse files Browse the repository at this point in the history
…ient-exception

catching and throwing guzzle client exceptions
  • Loading branch information
vcarstea-plenty authored Jan 5, 2023
2 parents e83ffad + dffeb97 commit 57661bf
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()}",
Expand Down Expand Up @@ -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()}",
Expand Down

0 comments on commit 57661bf

Please sign in to comment.