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

This commit is contained in:
kolaente
2024-08-29 15:39:34 +02:00
parent bea131cfd9
commit 7a7e97770c
14 changed files with 45 additions and 50 deletions

View File

@@ -51,12 +51,12 @@ func checkExportRequest(c echo.Context) (s *xorm.Session, u *user.User, err erro
var pass UserPasswordConfirmation
if err := c.Bind(&pass); err != nil {
return nil, nil, echo.NewHTTPError(http.StatusBadRequest, "No password provided.")
return nil, nil, echo.NewHTTPError(http.StatusBadRequest, "No password provided.").SetInternal(err)
}
err = c.Validate(pass)
if err != nil {
return nil, nil, echo.NewHTTPError(http.StatusBadRequest, err)
return nil, nil, echo.NewHTTPError(http.StatusBadRequest, err).SetInternal(err)
}
err = user.CheckUserPassword(u, pass.Password)