h1. WHAT
Define a custom error handling package which can be used instead of Echo's default.
h1. WHY
The default HTTP error handling that comes with Echo is a bit verbose and could do with improvements.
Example:
{code:go} return echo.NewHTTPError(http.StatusUnauthorized, "Please provide valid credentials") {code} This could be improved to be like this:
{code:go} return errors.Unauthorized("Please provide valid credentials") {code} |
|