Skip to content

Commit

Permalink
TypeError method_exists
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 authored Apr 7, 2023
1 parent a83c032 commit 8e8b2bd
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 @@ -141,6 +141,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 8e8b2bd

Please sign in to comment.