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

@ -51,8 +51,7 @@ func ProjectHandler(c echo.Context) error {
u, err := getBasicAuthUserFromContext(c)
if err != nil {
log.Error(err)
return echo.ErrInternalServerError
return echo.ErrInternalServerError.SetInternal(err)
}
storage := &VikunjaCaldavProjectStorage{
@ -69,8 +68,7 @@ func ProjectHandler(c echo.Context) error {
if vtodo != "" && strings.HasPrefix(vtodo, `BEGIN:VCALENDAR`) {
storage.task, err = caldav2.ParseTaskFromVTODO(vtodo)
if err != nil {
log.Error(err)
return echo.ErrInternalServerError
return echo.ErrInternalServerError.SetInternal(err)
}
}
@ -94,8 +92,7 @@ func TaskHandler(c echo.Context) error {
u, err := getBasicAuthUserFromContext(c)
if err != nil {
log.Error(err)
return echo.ErrInternalServerError
return echo.ErrInternalServerError.SetInternal(err)
}
// Get the task uid
@ -117,8 +114,7 @@ func TaskHandler(c echo.Context) error {
func PrincipalHandler(c echo.Context) error {
u, err := getBasicAuthUserFromContext(c)
if err != nil {
log.Error(err)
return echo.ErrInternalServerError
return echo.ErrInternalServerError.SetInternal(err)
}
storage := &VikunjaCaldavProjectStorage{
@ -147,8 +143,7 @@ func PrincipalHandler(c echo.Context) error {
func EntryHandler(c echo.Context) error {
u, err := getBasicAuthUserFromContext(c)
if err != nil {
log.Error(err)
return echo.ErrInternalServerError
return echo.ErrInternalServerError.SetInternal(err)
}
storage := &VikunjaCaldavProjectStorage{