|
@@ -17,6 +17,8 @@ declare (strict_types=1);
|
|
|
|
|
|
namespace think\admin\extend;
|
|
|
|
|
|
+use think\admin\Exception;
|
|
|
+
|
|
|
/**
|
|
|
* JsonRpc 客户端
|
|
|
* Class JsonRpcClient
|
|
@@ -51,7 +53,7 @@ class JsonRpcClient
|
|
|
* @param string $method
|
|
|
* @param array $params
|
|
|
* @return mixed
|
|
|
- * @throws \think\admin\Exception
|
|
|
+ * @throws Exception
|
|
|
*/
|
|
|
public function __call(string $method, array $params)
|
|
|
{
|
|
@@ -75,16 +77,16 @@ class JsonRpcClient
|
|
|
fclose($fp);
|
|
|
$response = json_decode($response, true);
|
|
|
} else {
|
|
|
- throw new \think\admin\Exception("无法连接到 {$this->proxy}");
|
|
|
+ throw new Exception("无法连接到 {$this->proxy}");
|
|
|
}
|
|
|
// Final checks and return
|
|
|
if ($response['id'] != $this->id) {
|
|
|
- throw new \think\admin\Exception("错误的响应标记 (请求标记: {$this->id}, 响应标记: {$response['id']})");
|
|
|
+ throw new Exception("错误标记 (请求标记: {$this->id}, 响应标记: {$response['id']})");
|
|
|
}
|
|
|
if (is_null($response['error'])) {
|
|
|
return $response['result'];
|
|
|
} else {
|
|
|
- throw new \think\admin\Exception("请求错误:{$response['error']['message']}", $response['error']['code']);
|
|
|
+ throw new Exception("请求错误:{$response['error']['message']}", $response['error']['code']);
|
|
|
}
|
|
|
}
|
|
|
}
|