fixing wrong status code if alreay echo http error

This commit is contained in:
Julien Neuhart
2019-08-27 16:50:27 +02:00
parent 438fd7d825
commit 36847e6a06

View File

@@ -111,6 +111,8 @@ func doErr(ctx context.Context, err error) error {
// if it's an error from echo // if it's an error from echo
// like 404 not found and so on. // like 404 not found and so on.
if echoHTTPErr, ok := err.(*echo.HTTPError); ok { if echoHTTPErr, ok := err.(*echo.HTTPError); ok {
// required to have a correct status code.
ctx.Error(echoHTTPErr)
return echoHTTPErr return echoHTTPErr
} }
// we log the initial error before returning // we log the initial error before returning