1
0

chore(errors): always add internal error to echo error

(cherry picked from commit 7a7e97770c9ecc10e805069ae16c2ffa2779d2a5)
This commit is contained in:
kolaente
2024-08-29 15:39:34 +02:00
parent 39d0409f57
commit cfa58ae599
14 changed files with 45 additions and 50 deletions

View File

@ -34,12 +34,12 @@ func DocsJSON(c echo.Context) error {
doc, err := swag.ReadDoc()
if err != nil {
log.Error(err.Error())
return echo.NewHTTPError(http.StatusInternalServerError)
return echo.NewHTTPError(http.StatusInternalServerError).SetInternal(err)
}
_, err = c.Response().Write([]byte(doc))
if err != nil {
log.Error(err.Error())
return echo.NewHTTPError(http.StatusInternalServerError)
return echo.NewHTTPError(http.StatusInternalServerError).SetInternal(err)
}
return nil