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 aefc355 commit 62d3e8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,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
2 changes: 1 addition & 1 deletion tests/spot_v2/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
]);

try {
$result=$bitget->account()->getInfo();
$result=$bitget->account()->getAssets();
print_r($result);
}catch (\Exception $e){
print_r(json_decode($e->getMessage(),true));
Expand Down

0 comments on commit 62d3e8b

Please sign in to comment.