Skip to content

Commit

Permalink
add throw new exception msg
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouaini528 committed Sep 4, 2023
1 parent 91f844b commit ecfa1c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Api/Trader.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function buy(array $data,bool $show=true){
'_trader_result'=>$result
]);
}catch (\Exception $e){
return $this->error($e->getMessage());
return $this->error(json_encode(array_merge($data,['_msg'=>$e->getMessage()])));
}
}

Expand Down Expand Up @@ -142,7 +142,7 @@ function sell(array $data,bool $show=true){
'_trader_result'=>$result
]);
}catch (\Exception $e){
return $this->error($e->getMessage());
return $this->error(json_encode(array_merge($data,['_msg'=>$e->getMessage()])));
}
}

Expand Down Expand Up @@ -202,7 +202,7 @@ function cancel(array $data,bool $show=true){
'_trader_result'=>$result
]);
}catch (\Exception $e){
return $this->error($e->getMessage());
return $this->error(json_encode(array_merge($data,['_msg'=>$e->getMessage()])));
}
}

Expand Down

0 comments on commit ecfa1c2

Please sign in to comment.