From dda298eed51197379ffa61b57a697e1da65c5608 Mon Sep 17 00:00:00 2001 From: aupous Date: Tue, 18 Aug 2020 16:59:54 +0700 Subject: [PATCH 1/2] fix: update request guild --- website/content/guide/request.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/guide/request.md b/website/content/guide/request.md index 1f86da17..8d97b3a6 100644 --- a/website/content/guide/request.md +++ b/website/content/guide/request.md @@ -191,7 +191,7 @@ func main() { return } if err = c.Validate(u); err != nil { - return + return echo.NewHTTPError(http.StatusBadRequest, err.Error()) } return c.JSON(http.StatusOK, u) }) From fdc52524d0b0632d87f1120451bec6d5503046e6 Mon Sep 17 00:00:00 2001 From: Roland Lammel Date: Sun, 22 Nov 2020 21:28:11 +0100 Subject: [PATCH 2/2] Update request.md Ensure also error is returned for bind not only validator --- website/content/guide/request.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/guide/request.md b/website/content/guide/request.md index 8d97b3a6..b06dc82f 100644 --- a/website/content/guide/request.md +++ b/website/content/guide/request.md @@ -188,7 +188,7 @@ func main() { e.POST("/users", func(c echo.Context) (err error) { u := new(User) if err = c.Bind(u); err != nil { - return + return echo.NewHTTPError(http.StatusBadRequest, err.Error()) } if err = c.Validate(u); err != nil { return echo.NewHTTPError(http.StatusBadRequest, err.Error())