diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-12-13 17:31:22 +0100 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-12-13 17:31:22 +0100 |
commit | a1634db89fe9097c1739e0c6d11265aa7b8bdd3f (patch) | |
tree | 22857d3ede264f26e09de7c0fec4db9a1b58ac5a /pkg/service/git.go | |
parent | fa7b51a709413a214fbd5157fe0f32138a889f0d (diff) | |
download | cerrado-a1634db89fe9097c1739e0c6d11265aa7b8bdd3f.tar.gz cerrado-a1634db89fe9097c1739e0c6d11265aa7b8bdd3f.tar.bz2 cerrado-a1634db89fe9097c1739e0c6d11265aa7b8bdd3f.zip |
ref: Better log errorsv0.0.18
Some error were being ignored and not logged, making debugging what
failed impossible.
Diffstat (limited to 'pkg/service/git.go')
-rw-r--r-- | pkg/service/git.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/service/git.go b/pkg/service/git.go index afe6103..12d238e 100644 --- a/pkg/service/git.go +++ b/pkg/service/git.go @@ -8,6 +8,7 @@ import ( "git.gabrielgio.me/cerrado/pkg/config" "git.gabrielgio.me/cerrado/pkg/git" + gogit "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" ) @@ -49,6 +50,10 @@ func (g *GitService) ListRepositories() ([]*Repository, error) { for _, r := range rs { repo, err := git.OpenRepository(r.Path) if err != nil { + if errors.Is(err, gogit.ErrRepositoryNotExists) { + slog.Info("Path does not contain a repository", "path", r.Path) + continue + } return nil, err } |