- refactor platformapi.AccessPlatformAPIWithRetry
This commit is contained in:
@@ -129,12 +129,7 @@ func (a *API) AccessAPI(cmd string, isGet bool, bizParams map[string]interface{}
|
||||
return request
|
||||
},
|
||||
a.config,
|
||||
func(response *http.Response) (errLevel string, err error) {
|
||||
jsonResult1, err := utils.HTTPResponse2Json(response)
|
||||
// baseapi.SugarLogger.Debug(utils.Format4Output(jsonResult1, false))
|
||||
if err != nil {
|
||||
return platformapi.ErrLevelGeneralFail, platformapi.ErrResponseDataFormatWrong
|
||||
}
|
||||
func(jsonResult1 map[string]interface{}) (errLevel string, err error) {
|
||||
if _, ok := jsonResult1["error"]; ok {
|
||||
baseapi.SugarLogger.Debugf("mtwm AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
errorInfo := jsonResult1["error"].(map[string]interface{})
|
||||
|
||||
Reference in New Issue
Block a user