Skip to content

Commit

Permalink
#859 monitor接入标准日志规范
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjiawei committed Dec 30, 2024
1 parent a5540f9 commit 0606f8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions monitor-server/middleware/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0606f8d

Please sign in to comment.