1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-13 01:30:31 +02:00

Not sending internal errors

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2016-12-29 08:19:52 -08:00
parent 04ed761d41
commit 6e107bc897

View File

@ -289,9 +289,9 @@ func (e *Echo) DefaultHTTPErrorHandler(err error, c Context) {
code = he.Code code = he.Code
msg = he.Message msg = he.Message
} else { } else {
msg = err.Error() msg = http.StatusText(code)
} }
if reflect.TypeOf(msg).Kind() != reflect.Ptr { if _, ok := msg.(string); ok {
msg = Map{"message": msg} msg = Map{"message": msg}
} }