From 2d8e8ceb152f59c3aa4281ad7d355c0ab61313ed Mon Sep 17 00:00:00 2001 From: PatrickePatate Date: Tue, 24 Sep 2024 10:06:51 +0200 Subject: [PATCH] Fix error not throwing --- src/MachinaClient.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MachinaClient.php b/src/MachinaClient.php index 79d7095..024a783 100755 --- a/src/MachinaClient.php +++ b/src/MachinaClient.php @@ -5,6 +5,7 @@ use Code16\MachinaClient\Exceptions\InvalidCredentialsException; use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\BadResponseException; use Illuminate\Support\Str; use Psr\Log\LoggerInterface; @@ -221,7 +222,7 @@ protected function sendRequest(string $method, string $uri, array $data = null) 'headers' => $this->buildHeaders(), ]); - } catch (RequestException $e) { + } catch (BadResponseException | RequestException $e) { $this->logDebug("Error ".$e->getCode().":".$e->getMessage()); if($e->getCode() == 401) {