diff --git a/src/Request.php b/src/Request.php index 0f8367d..4ac3a01 100644 --- a/src/Request.php +++ b/src/Request.php @@ -148,6 +148,8 @@ protected function exec(){ try { return json_decode($this->send(),true); }catch (RequestException $e){ + if(empty($e->getResponse()) || $e->getResponse()==null) throw new Exception(json_encode(['_message'=>'system error'])); + if(method_exists($e->getResponse(),'getBody')){ $contents=$e->getResponse()->getBody()->getContents();