throw array 2 json
This commit is contained in:
parent
fd82951c4a
commit
b0ffeb7bad
|
@ -125,7 +125,8 @@ class Client
|
|||
try {
|
||||
$body = \GuzzleHttp\json_decode($resp->getBody(), true);
|
||||
if (isset($body['error']) && isset($body['error']['code']) && isset($body['error']['message'])) {
|
||||
throw new RpcServerException($body['error']['message'], $body['error']['code']);
|
||||
$message = is_array($body['error']['message']) ? json_encode($body['error']['message']) : $body['error']['message'];
|
||||
throw new RpcServerException($message, $body['error']['code']);
|
||||
}
|
||||
return $body['result'];
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user