- 清理三个平台的门店商品批处理操作,部分失败返回失败条目

This commit is contained in:
gazebo
2019-07-21 16:08:37 +08:00
parent 0298f7de71
commit 414c359200
12 changed files with 597 additions and 179 deletions

View File

@@ -183,15 +183,11 @@ func AccessPlatformAPIWithRetry(client *http.Client, handleRequest func() *http.
func RebuildError(inErr error, bzParams map[string]interface{}, watchKeys []string) (outErr error) {
if inErr != nil {
if codeErr, ok := inErr.(*utils.ErrorWithCode); ok {
appendErrList := []string{}
for _, key := range watchKeys {
if bzParams[key] != nil {
appendErrList = append(appendErrList, fmt.Sprintf("[%s:%v]", key, bzParams[key]))
codeErr.AddPrefixMsg(fmt.Sprintf("[%s:%v]", key, bzParams[key]))
}
}
if len(appendErrList) > 0 {
inErr = utils.NewErrorCode(strings.Join(appendErrList, ",")+", "+codeErr.ErrMsg(), codeErr.Code())
}
}
}
return inErr