From 5d7b2e8965c3db89be227b88a43cb96f692311c6 Mon Sep 17 00:00:00 2001 From: Yurun Date: Fri, 28 Feb 2020 15:42:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BD=91=E7=BB=9C=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E9=94=99=E8=AF=AF=E6=8A=9B=E5=87=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Base.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Base.php b/src/Base.php index a5a7213..921bc47 100644 --- a/src/Base.php +++ b/src/Base.php @@ -80,6 +80,10 @@ public function execute($params, $format = 'JSON') $this->prepareExecute($params, $url, $data); $this->url = $url; $this->response = $this->http->send($url, $this->requestData, $params->_method); + if(!$this->response->success) + { + throw new \RuntimeException(sprintf('Request error: [%s] %s', $this->response->errno(), $this->response->error())); + } switch($format) { case 'JSON':