diff options
Diffstat (limited to 'pkg/handler/git.go')
-rw-r--r-- | pkg/handler/git.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pkg/handler/git.go b/pkg/handler/git.go index 5b09121..1ed2c49 100644 --- a/pkg/handler/git.go +++ b/pkg/handler/git.go @@ -1,6 +1,7 @@ package handler import ( + "log/slog" "net/http" "git.gabrielgio.me/cerrado/pkg/service" @@ -16,6 +17,12 @@ func NewGitHandler(gitService *service.GitService) *GitHandler { } func (g *GitHandler) List(w http.ResponseWriter, _ *http.Request) { - gitList := &templates.GitListPage{g.gitService.ListRepositories()} + repos, err := g.gitService.ListRepositories() + if err != nil { + slog.Error("Error listing repo", "error", err) + return + } + + gitList := &templates.GitListPage{repos} templates.WritePageTemplate(w, gitList) } |