Skip to content

Commit

Permalink
less talkative on error
Browse files Browse the repository at this point in the history
  • Loading branch information
burgesQ committed Oct 10, 2024
1 parent 8421264 commit 70e42c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 70e42c1

Please sign in to comment.