diff options
Diffstat (limited to 'vendor/github.com/labstack/echo/v4/echo.go')
-rw-r--r-- | vendor/github.com/labstack/echo/v4/echo.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/vendor/github.com/labstack/echo/v4/echo.go b/vendor/github.com/labstack/echo/v4/echo.go index 552c7a78..a6ac0fa8 100644 --- a/vendor/github.com/labstack/echo/v4/echo.go +++ b/vendor/github.com/labstack/echo/v4/echo.go @@ -227,7 +227,7 @@ const ( const ( // Version of Echo - Version = "4.1.10" + Version = "4.1.13" website = "https://echo.labstack.com" // http://patorjk.com/software/taag/#p=display&f=Small%20Slant&t=Echo banner = ` @@ -354,10 +354,14 @@ func (e *Echo) DefaultHTTPErrorHandler(err error, c Context) { Message: http.StatusText(http.StatusInternalServerError), } } + + // Issue #1426 + code := he.Code + message := he.Message if e.Debug { - he.Message = err.Error() - } else if m, ok := he.Message.(string); ok { - he.Message = Map{"message": m} + message = err.Error() + } else if m, ok := message.(string); ok { + message = Map{"message": m} } // Send response @@ -365,7 +369,7 @@ func (e *Echo) DefaultHTTPErrorHandler(err error, c Context) { if c.Request().Method == http.MethodHead { // Issue #608 err = c.NoContent(he.Code) } else { - err = c.JSON(he.Code, he.Message) + err = c.JSON(code, message) } if err != nil { e.Logger.Error(err) |