Skip to content

Commit

Permalink
throw new Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Dec 21, 2023
1 parent b3c7f0e commit e66ca12
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,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();

Expand Down

0 comments on commit e66ca12

Please sign in to comment.