Skip to content

Commit 913231f

Browse files
committed
Throw exception on JSON-RPC error in endpoint discovery
1 parent 96bd3dd commit 913231f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

NutshellApi.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ protected function _getApiEndpointForUser($username) {
160160
curl_close($curl);
161161

162162
$decoded = $this->json_decode($result);
163+
if ($decoded->error !== NULL) {
164+
throw new NutshellApiException($decoded->error->message);
165+
}
163166
return 'https://' . $decoded->result->api . '/api/v1/json';
164167
}
165168

0 commit comments

Comments
 (0)