diff --git a/backend/internal/database/db.go b/backend/internal/database/db.go index ad408a7..bc6e1e8 100644 --- a/backend/internal/database/db.go +++ b/backend/internal/database/db.go @@ -204,15 +204,22 @@ func (d *Db) AddProject(name string, description string, username string) error tx := d.MustBegin() _, err := tx.Exec(projectInsert, name, description, username) if err != nil { - tx.Rollback() + if err := tx.Rollback(); err != nil { + return err + } return err } _, err = tx.Exec(changeUserRole, "project_manager", username, name) if err != nil { - tx.Rollback() + if err := tx.Rollback(); err != nil { + return err + } return err } - tx.Commit() + if err := tx.Commit(); err != nil { + return err + } + return err }