- handle 您的请求数已超过阈值 for ebaiapi

This commit is contained in:
gazebo
2019-03-07 12:14:56 +08:00
parent ac19798d33
commit c3feb969bd
2 changed files with 4 additions and 8 deletions

View File

@@ -121,10 +121,10 @@ func (a *API) AccessAPI(cmd string, body map[string]interface{}) (retVal *Respon
}
baseapi.SugarLogger.Debugf("ebai AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
newErr := utils.NewErrorIntCode(retVal.Error, retVal.ErrNo)
// todo 包括访问超频的很多错误都是这个错误号...
// if newErr.IntCode() == 20212 {
// return platformapi.ErrLevelExceedLimit, newErr
// }
// todo 临时处理超过阈值错...
if newErr.IntCode() == 20501 && strings.Index(retVal.Error, "阈值") >= 0 {
return platformapi.ErrLevelExceedLimit, newErr
}
return platformapi.ErrLevelCodeIsNotOK, newErr
})
return retVal, err

View File

@@ -13,10 +13,6 @@ const (
prodURL = "https://api.weixin.qq.com"
)
const (
actionGetToken = "token"
)
const (
ResponseCodeBusy = -1
ResponseCodeSuccess = 0