Always log an error even if it was a http error

This commit is contained in:
kolaente 2021-07-06 18:05:06 +02:00
parent 26386be9a9
commit d85def955b
Signed by: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -35,10 +35,10 @@ type CObject interface {
// HandleHTTPError does what it says
func HandleHTTPError(err error, ctx echo.Context) *echo.HTTPError {
config.LoggingProvider.Error(err.Error())
if a, has := err.(web.HTTPErrorProcessor); has {
errDetails := a.HTTPError()
return echo.NewHTTPError(errDetails.HTTPCode, errDetails)
}
config.LoggingProvider.Error(err.Error())
return echo.NewHTTPError(http.StatusInternalServerError)
}