fix handler exception
This commit is contained in:
parent
fcfba9c50b
commit
66c2ddad1c
@ -44,7 +44,7 @@ func RequestHandler(uriCfg UriConfig) gin.HandlerFunc {
|
|||||||
// 格式化验证错误的信息
|
// 格式化验证错误的信息
|
||||||
err = GetValidateErr(formValue, err)
|
err = GetValidateErr(formValue, err)
|
||||||
e = exception.NewFromError(400, err)
|
e = exception.NewFromError(400, err)
|
||||||
response.SendWithException(ctx, e, nil, &define.ResponseOption{
|
response.SendWithException(ctx, e, &define.ResponseOption{
|
||||||
ContentType: "application/json;charset=utf-8",
|
ContentType: "application/json;charset=utf-8",
|
||||||
})
|
})
|
||||||
ctx.Abort()
|
ctx.Abort()
|
||||||
@ -112,7 +112,7 @@ func RequestHandler(uriCfg UriConfig) gin.HandlerFunc {
|
|||||||
"err": resList[1].Interface(),
|
"err": resList[1].Interface(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
response.SendWithException(ctx, e, nil, &define.ResponseOption{
|
response.SendWithException(ctx, e, &define.ResponseOption{
|
||||||
ContentType: "application/json;charset=utf-8",
|
ContentType: "application/json;charset=utf-8",
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user