Skip to content

Commit

Permalink
Request
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Apr 25, 2019
1 parent b5ed815 commit 2a5ded8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ protected function exec(){

//可以记录日志
try {
return json_decode($this->send(),true);
$temp=json_decode($this->send(),true);
if(isset($temp['status']) && $temp['status']=='error') throw new Exception(json_encode($temp));

return $temp;
}catch (RequestException $e){
if(method_exists($e->getResponse(),'getBody')){
$contents=$e->getResponse()->getBody()->getContents();
Expand Down

0 comments on commit 2a5ded8

Please sign in to comment.