Fixed not setting http code on error

This commit is contained in:
kolaente 2018-10-11 18:18:44 +02:00
parent d8f6a628db
commit bbd90eb976
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -22,7 +22,7 @@ type CObject interface {
func HandleHTTPError(err error) *echo.HTTPError { func HandleHTTPError(err error) *echo.HTTPError {
if a, has := err.(models.HTTPErrorProcessor); has { if a, has := err.(models.HTTPErrorProcessor); has {
errDetails := a.HTTPError() errDetails := a.HTTPError()
return echo.NewHTTPError(errDetails.Code, errDetails) return echo.NewHTTPError(errDetails.HTTPCode, errDetails)
} }
models.Log.Error(err.Error()) models.Log.Error(err.Error())
return echo.NewHTTPError(http.StatusInternalServerError) return echo.NewHTTPError(http.StatusInternalServerError)