This commit is contained in:
gazebo
2020-01-14 19:20:59 +08:00
parent 23b58f605a
commit 5178e53dd6

View File

@@ -178,13 +178,15 @@ func (a *API) AccessAPI2(cmd string, isGet bool, bizParams map[string]interface{
if errObj, ok := jsonResult1["error"]; ok {
baseapi.SugarLogger.Debugf("mtwm AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
errorInfo := errObj.(map[string]interface{})
newErr := utils.NewErrorIntCode(errorInfo["msg"].(string), int(utils.MustInterface2Int64(errorInfo["code"])))
if canRetryCodes[newErr.IntCode()] == 1 {
errCode := int(utils.MustInterface2Int64(errorInfo["code"]))
newErr := utils.NewErrorIntCode(errorInfo["msg"].(string), errCode)
if canRetryCodes[errCode] == 1 {
return platformapi.ErrLevelExceedLimit, newErr
} else if canRecoverCodes[newErr.IntCode()] == 1 {
} else if canRecoverCodes[errCode] == 1 {
return platformapi.ErrLevelRecoverableErr, newErr
} else if errCode != 0 {
return platformapi.ErrLevelCodeIsNotOK, newErr
}
return platformapi.ErrLevelCodeIsNotOK, newErr
}
return platformapi.ErrLevelSuccess, nil
})