From 0606f8df7407b413516e24812a5fcf0e01e951c0 Mon Sep 17 00:00:00 2001 From: tangjiawei Date: Mon, 30 Dec 2024 19:49:16 +0800 Subject: [PATCH] =?UTF-8?q?#859=20monitor=E6=8E=A5=E5=85=A5=E6=A0=87?= =?UTF-8?q?=E5=87=86=E6=97=A5=E5=BF=97=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- monitor-server/middleware/response.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/monitor-server/middleware/response.go b/monitor-server/middleware/response.go index 571eee2f9..5c203509f 100644 --- a/monitor-server/middleware/response.go +++ b/monitor-server/middleware/response.go @@ -119,16 +119,16 @@ func ReturnRequestJsonError(c *gin.Context, err error) { func ReturnHandleError(c *gin.Context, msg string, err error) { if err != nil { - log.Logger.Warn("Return Error", log.String("msg", msg)) var customErr models.CustomError if errors.As(err, &customErr) { + log.Logger.Warn("Return Error", log.String("msg", msg)) ReturnError(c, customErr, http.StatusOK) } else { - ReturnError(c, models.GetMessageMap(c).HandleError, http.StatusOK) + ReturnError(c, models.GetMessageMap(c).HandleError.WithParam(msg), http.StatusOK) } return } - ReturnError(c, models.GetMessageMap(c).HandleError, http.StatusOK) + ReturnError(c, models.GetMessageMap(c).HandleError.WithParam(msg), http.StatusOK) } func ReturnServerHandleError(c *gin.Context, err error) {