diff --git a/src/Libs/BaseService.php b/src/Libs/BaseService.php index 28fa2c9..8248388 100644 --- a/src/Libs/BaseService.php +++ b/src/Libs/BaseService.php @@ -109,7 +109,7 @@ public function request($url, array $data = [], string $method = 'get'): string| } catch (RequestException $e) { $this->errorMessage = urldecode($e->getMessage()); $this->errorCode = $e->getCode(); - if ($e->getResponse()->getStatusCode() == 400) + if ($e->hasResponse() && $e->getResponse()?->getStatusCode() == 400) $this->errorMessage = urldecode($e->getResponse()->getBody()->getContents()); } catch (Exception $e) { $this->errorCode = $e->getCode();