diff --git a/NutshellApi.php b/NutshellApi.php index 8ef5978..460ec32 100755 --- a/NutshellApi.php +++ b/NutshellApi.php @@ -160,6 +160,9 @@ protected function _getApiEndpointForUser($username) { curl_close($curl); $decoded = $this->json_decode($result); + if ($decoded->error !== NULL) { + throw new NutshellApiException($decoded->error->message); + } return 'https://' . $decoded->result->api . '/api/v1/json'; }