diff --git a/src/ResultTypes/GetResult.php b/src/ResultTypes/GetResult.php index 04e576f..2994f8b 100644 --- a/src/ResultTypes/GetResult.php +++ b/src/ResultTypes/GetResult.php @@ -23,7 +23,14 @@ public function __construct(Response $apiResponse = null, string $errorMessage = } else { $this->data = $apiResponse->body; - $this->errorMessage = !empty($this->errorMessage) ? $this->errorMessage : isset($apiResponse->body->error) ? $apiResponse->body->error : ''; + if(empty($this->errorMessage)) { + if(isset($apiResponse->body->error)) { + $this->errorMessage = $apiResponse->body->error; + } else { + $this->errorMessage = ''; + } + } + if ($apiResponse->code >= 200 && $apiResponse->code < 300) { $this->isSuccess = (strlen($this->errorMessage) == 0); }