From 66c2ddad1c97eb9e95bf9fcca1c6c3db22847eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Sat, 10 May 2025 20:46:37 +0800 Subject: [PATCH] fix handler exception --- router/handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/router/handler.go b/router/handler.go index 34f5490..25e40bf 100644 --- a/router/handler.go +++ b/router/handler.go @@ -44,7 +44,7 @@ func RequestHandler(uriCfg UriConfig) gin.HandlerFunc { // 格式化验证错误的信息 err = GetValidateErr(formValue, 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", }) ctx.Abort() @@ -112,7 +112,7 @@ func RequestHandler(uriCfg UriConfig) gin.HandlerFunc { "err": resList[1].Interface(), }) } - response.SendWithException(ctx, e, nil, &define.ResponseOption{ + response.SendWithException(ctx, e, &define.ResponseOption{ ContentType: "application/json;charset=utf-8", }) return