From 70e42c15387b0ca4ee5835c3142bb4cccceb50af Mon Sep 17 00:00:00 2001 From: Quentin Burgess Date: Thu, 10 Oct 2024 10:43:57 +0200 Subject: [PATCH] less talkative on error --- context.go | 6 ++---- handler.go | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/context.go b/context.go index c38f08f..abcfe79 100644 --- a/context.go +++ b/context.go @@ -137,12 +137,10 @@ func (c *icontext) FetchContent(dest interface{}) ErrorHandled { // Validate implement Context // this implemtation use validator to anotate & check struct func (c *icontext) Validate(dest interface{}) ErrorHandled { - if e := validate.Struct(dest); e != nil { - c.slog.Error("validating form or query param", slog.Any("error", e)) - + if err := validate.Struct(dest); err != nil { var ev validator.ValidationErrors - errors.As(e, &ev) + errors.As(err, &ev) return NewUnprocessable(ValidationError{ Status: http.StatusUnprocessableEntity, diff --git a/handler.go b/handler.go index 6ed230f..94c49df 100644 --- a/handler.go +++ b/handler.go @@ -41,7 +41,6 @@ func GetIPFromRequest(fc *fasthttp.RequestCtx) string { func handleHandlerError(next HandlerFunc) HandlerFunc { return HandlerFunc(func(c Context) error { if e := next(c); e != nil { - c.GetStructuredLogger().Error("catch'd from handler", "error", e) HandleError(c, e) }