- business msg added to error

This commit is contained in:
gazebo
2018-06-20 07:34:11 +08:00
parent 6fc94315f4
commit 7785ef6485
5 changed files with 6 additions and 2 deletions

View File

@@ -49,6 +49,7 @@ func (e *ELMAPI) unmarshalData(data []byte, msg interface{}) (callbackResponse *
func (e *ELMAPI) CheckRequestValidation(mapData map[string]interface{}) (callbackResponse *ELMCallbackResponse) {
sign := e.signParamsMap(mapData, "")
if sign != mapData[signKey].(string) {
e.sugarLogger.Infof("Signature is not ok, mine:%v, get:%v", sign, mapData[signKey].(string))
return &ELMCallbackResponse{Message: "signature is invalid"}
}
return nil

View File

@@ -153,7 +153,7 @@ func (e *ELMAPI) AccessELM(action string, params map[string]interface{}) (retVal
} else if errCode == "SERVER_ERROR" || errCode == "BIZ_SYSTEM_ERROR" || errCode == "BIZ_1006" || errCode == "BUSINESS_ERROR" {
return common.PAErrorLevelRecoverable, nil
} else {
return errCode, nil
return common.PAErrorLevelGeneralFail, utils.NewErrorCode(errinfoMap["message"].(string), errCode)
}
})