diff --git a/src/Client.php b/src/Client.php index 8c7e6a2..4a84519 100644 --- a/src/Client.php +++ b/src/Client.php @@ -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'];