diff --git a/Exception/Result/BusinessException.php b/Exception/Result/ServiceException.php similarity index 81% rename from Exception/Result/BusinessException.php rename to Exception/Result/ServiceException.php index f380d6b..56335f3 100755 --- a/Exception/Result/BusinessException.php +++ b/Exception/Result/ServiceException.php @@ -15,9 +15,9 @@ namespace Zepgram\Rest\Exception\Result; -use Zepgram\Rest\Exception\InternalException; +use Zepgram\Rest\Exception\ExternalException; -class BusinessException extends InternalException +class ServiceException extends ExternalException { } diff --git a/Model/HttpClient.php b/Model/HttpClient.php index e6dc80b..a501207 100755 --- a/Model/HttpClient.php +++ b/Model/HttpClient.php @@ -25,7 +25,7 @@ use Throwable; use Zepgram\Rest\Exception\ExternalException; use Zepgram\Rest\Exception\InternalException; -use Zepgram\Rest\Exception\Result\BusinessException; +use Zepgram\Rest\Exception\Result\ServiceException; use Zepgram\Rest\Exception\Result\HttpException; use Zepgram\Rest\Exception\Result\NotFoundException; use Zepgram\Rest\Exception\Result\UnserializeException; @@ -110,7 +110,7 @@ public function request(ParametersInterface $parameters): string|int|bool|array| /** * @param ParametersInterface $parameters * @return ResponseInterface - * @throws BusinessException + * @throws ServiceException * @throws HttpException * @throws NotFoundException */ @@ -138,7 +138,7 @@ private function guzzleRequest(ParametersInterface $parameters): ResponseInterfa throw new NotFoundException(__('[REST API] %1 not found: %2', $serviceName, $body), $e, $e->getCode()); } if (!empty($body) && $e->getCode() < 500) { - throw new BusinessException(__('[REST API] %1 error: %2', $serviceName, $body), $e, $e->getCode()); + throw new ServiceException(__('[REST API] %1 error: %2', $serviceName, $body), $e, $e->getCode()); } throw new HttpException(__('[REST API] %1', $serviceName), $e, $e->getCode()); } catch (Throwable $e) { diff --git a/composer.json b/composer.json index 09c389b..2d78ce0 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "zepgram/module-rest", "description": "Technical module to industrialize API REST call with dependency injection pattern using Guzzle library in Magento 2", "type": "magento2-module", - "version": "1.1.0", + "version": "1.1.1", "authors": [ { "name": "Benjamin Calef",