修复提取不到业务状态码未报错问题

This commit is contained in:
白茶清欢 2023-08-27 16:01:05 +08:00
parent db90755651
commit 7e71a76959

View File

@ -303,6 +303,7 @@ func send(apiConfig *ApiRequestConfig, header map[string]string) *ApiResponse {
response.Exception = exception.New(ResponseCodeNotFound, response.Response.StatusCode, map[string]string{ response.Exception = exception.New(ResponseCodeNotFound, response.Response.StatusCode, map[string]string{
"real_reason": "parse response business code fail", "real_reason": "parse response business code fail",
}, fmt.Sprintf("business code location : %v, business code name : %v, parse business code fail", response.RequestConfig.ResponseCodeFieldLocation, response.RequestConfig.ResponseCodeField)) }, fmt.Sprintf("business code location : %v, business code name : %v, parse business code fail", response.RequestConfig.ResponseCodeFieldLocation, response.RequestConfig.ResponseCodeField))
return response
} }
// 提取响应文案 // 提取响应文案
response.Message = gjson.GetBytes(responseByte, response.RequestConfig.ResponseMessageField).String() response.Message = gjson.GetBytes(responseByte, response.RequestConfig.ResponseMessageField).String()