- try to append shop info in err msg when ebai api failed.
This commit is contained in:
@@ -127,5 +127,21 @@ func (a *API) AccessAPI(cmd string, body map[string]interface{}) (retVal *Respon
|
||||
}
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
})
|
||||
if err != nil {
|
||||
if codeErr, ok := err.(*utils.ErrorWithCode); ok {
|
||||
if body[KeyBaiduShopID] != nil || body[KeyShopID] != nil {
|
||||
shopInfoList := []string{}
|
||||
for _, key := range []string{
|
||||
KeyBaiduShopID,
|
||||
KeyShopID,
|
||||
} {
|
||||
if body[key] != nil {
|
||||
shopInfoList = append(shopInfoList, fmt.Sprintf("[%s:%v]", key, body[key]))
|
||||
}
|
||||
}
|
||||
err = utils.NewErrorCode(strings.Join(shopInfoList, ",")+", "+codeErr.ErrMsg(), codeErr.Code())
|
||||
}
|
||||
}
|
||||
}
|
||||
return retVal, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user