From 5d9afc817ab415b1c3519718744569e4b23a8eeb Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 26 Jun 2023 22:29:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=94=AE=E8=A3=85=E5=A4=87=20?= =?UTF-8?q?=E8=BF=94=E5=9B=9Eerr=20=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/smithy/api_trade.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/smithy/api_trade.go b/modules/smithy/api_trade.go index a86b1eafc..cf6a510ad 100644 --- a/modules/smithy/api_trade.go +++ b/modules/smithy/api_trade.go @@ -1,7 +1,6 @@ package smithy import ( - "errors" "go_dreamfactory/comm" "go_dreamfactory/pb" ) @@ -28,13 +27,13 @@ func (this *apiComp) Sell(session comm.IUserSession, req *pb.SmithySellReq) (err this.module.ModuleEquipment.RecycleEquipments(session, req.EquipIds, this.module.modelStove.StoveToolsSellUp(session.GetUserId())) cus, err := this.module.modelTrade.updateCustomer(session.GetUserId(), req.CustomerId) - var customErr = new(comm.CustomError) - if errors.As(err, &customErr) { - code := customErr.Code + if err != nil { errdata = &pb.ErrorData{ - Code: code, - Title: code.ToString(), + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + Message: err.Error(), } + return } conf, err := this.module.configure.GetSmithyCustomerConf(req.CustomerId)