diff options
Diffstat (limited to 'pkg/handler')
| -rw-r--r-- | pkg/handler/git.go | 9 | ||||
| -rw-r--r-- | pkg/handler/status.go | 2 | 
2 files changed, 9 insertions, 2 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)  } diff --git a/pkg/handler/status.go b/pkg/handler/status.go index 2a84a7e..1ca7f70 100644 --- a/pkg/handler/status.go +++ b/pkg/handler/status.go @@ -19,7 +19,7 @@ func ConfigFile(configPath string) func(http.ResponseWriter, *http.Request) {  	return func(w http.ResponseWriter, _ *http.Request) {  		f, err := os.Open(configPath)  		if err != nil { -			slog.Error("Error openning config file json", "error", err, "path", configPath) +			slog.Error("Error openning config file", "error", err, "path", configPath)  			return  		} | 
