From ecfa1c23af8799abddbafe474f46713956641a9f Mon Sep 17 00:00:00 2001 From: zhouaini528 <465382251@qq.com> Date: Mon, 4 Sep 2023 14:19:50 +0800 Subject: [PATCH] add throw new exception msg --- src/Api/Trader.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Api/Trader.php b/src/Api/Trader.php index f3ec5d5..05ee05b 100644 --- a/src/Api/Trader.php +++ b/src/Api/Trader.php @@ -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()]))); } } @@ -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()]))); } } @@ -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()]))); } }