1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14: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
msg = he.Message
} else {
msg = err.Error()
msg = http.StatusText(code)
}
if reflect.TypeOf(msg).Kind() != reflect.Ptr {
if _, ok := msg.(string); ok {
msg = Map{"message": msg}
}