From 91f844b18d2709cb2ed0d9c002eee74bb595aa15 Mon Sep 17 00:00:00 2001 From: zhouaini528 <465382251@qq.com> Date: Fri, 25 Aug 2023 17:38:50 +0800 Subject: [PATCH] add throw new exception msg --- src/Api/Trader.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Api/Trader.php b/src/Api/Trader.php index dcfea68..f3ec5d5 100644 --- a/src/Api/Trader.php +++ b/src/Api/Trader.php @@ -40,7 +40,6 @@ class Trader extends Base implements TraderInterface * */ function buy(array $data,bool $show=true){ try { - //print_r($data); $requestTrader=$this->map->requestTrader(); $map=$requestTrader->buy($data); @@ -72,6 +71,7 @@ function buy(array $data,bool $show=true){ '_order_id'=>$trader['_order_id'] ?? '', '_client_id'=>$trader['_client_id'] ?? '', + '_trader_result'=>$result ]); }catch (\Exception $e){ return $this->error($e->getMessage()); @@ -139,6 +139,7 @@ function sell(array $data,bool $show=true){ '_order_id'=>$trader['_order_id'] ?? '', '_client_id'=>$trader['_client_id'] ?? '', + '_trader_result'=>$result ]); }catch (\Exception $e){ return $this->error($e->getMessage()); @@ -198,6 +199,7 @@ function cancel(array $data,bool $show=true){ '_order_id'=>$trader['_order_id'] ?? '', '_client_id'=>$trader['_client_id'] ?? '', + '_trader_result'=>$result ]); }catch (\Exception $e){ return $this->error($e->getMessage()); @@ -245,7 +247,7 @@ function show(array $data){ return $trader; }catch (\Exception $e){ - return $this->error($e->getMessage(),'system error'); + return $this->error(json_encode(array_merge($data,['_msg'=>$e->getMessage()]))); } }