1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-28 08:38:39 +02:00

Send error details when Echo#Debug is true, #817

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2017-09-21 08:46:47 -07:00
parent b7c4ccf8f3
commit b5de47f165

View File

@ -320,11 +320,11 @@ func (e *Echo) DefaultHTTPErrorHandler(err error, c Context) {
if he, ok := err.(*HTTPError); ok {
code = he.Code
msg = he.Message
} else if e.Debug {
msg = err.Error()
if he.Inner != nil {
msg = fmt.Sprintf("%v, %v", err, he.Inner)
}
} else if e.Debug {
msg = err.Error()
} else {
msg = http.StatusText(code)
}