From b99459b97fc085cd9ea5e35ee88e46ac51948832 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 31 Oct 2018 15:23:33 +0800 Subject: [PATCH] - handle jd partial failed. --- platformapi/jdapi/jdapi.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platformapi/jdapi/jdapi.go b/platformapi/jdapi/jdapi.go index e9f94d51..e74cc5c5 100644 --- a/platformapi/jdapi/jdapi.go +++ b/platformapi/jdapi/jdapi.go @@ -43,6 +43,8 @@ const ( ResponseInnerCodeOrderAlreadyPickedUp = "10132" ResponseInnerCodeOrderCanceled = "10138" ResponseInnerCodeOrderLocked = "10139" + + ResponseInnerCodePartialFailed = "190005" ) const ( @@ -213,7 +215,11 @@ func genNoPageResultParser(codeKey, msgKey, resultKey, okCode string) func(data return nil, nil } if msg, ok := data[msgKey]; ok { - return nil, utils.NewErrorCode(msg.(string), innerCode, 1) + errMsg := msg.(string) + if innerCode == ResponseInnerCodePartialFailed { + errMsg += ", " + utils.Format4Output(data[resultKey], true) + } + return nil, utils.NewErrorCode(errMsg, innerCode, 1) } panic(fmt.Sprintf("genNoPageResultParser msgKey %s can not be found in result:%v", msgKey, data)) }