Unify errors

This commit is contained in:
2024-11-09 23:12:52 +01:00
parent 7b1da94e8a
commit 118591df62
3 changed files with 8 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
package filesystem
import (
"errors"
"fmt"
"novamd/internal/gitutils"
)
@@ -29,7 +29,7 @@ func (fs *FileSystem) DisableGitRepo(userID, workspaceID int) {
func (fs *FileSystem) StageCommitAndPush(userID, workspaceID int, message string) error {
repo, ok := fs.getGitRepo(userID, workspaceID)
if !ok {
return errors.New("git settings not configured for this workspace")
return fmt.Errorf("git settings not configured for this workspace")
}
if err := repo.Commit(message); err != nil {
@@ -43,7 +43,7 @@ func (fs *FileSystem) StageCommitAndPush(userID, workspaceID int, message string
func (fs *FileSystem) Pull(userID, workspaceID int) error {
repo, ok := fs.getGitRepo(userID, workspaceID)
if !ok {
return errors.New("git settings not configured for this workspace")
return fmt.Errorf("git settings not configured for this workspace")
}
return repo.Pull()