enhance joinURL and return error on gitea client on start instead while running

This commit is contained in:
6543 2022-06-11 21:42:28 +02:00
parent 35b35c5d67
commit 1596ab9764
4 changed files with 23 additions and 18 deletions

View file

@ -82,7 +82,10 @@ func Serve(ctx *cli.Context) error {
// TODO: make this an MRU cache with a size limit
fileResponseCache := cache.NewKeyValueCache()
giteaClient := gitea.NewClient(giteaRoot, giteaAPIToken)
giteaClient, err := gitea.NewClient(giteaRoot, giteaAPIToken)
if err != nil {
return fmt.Errorf("could not create new gitea client: %v", err)
}
// Create handler based on settings
handler := server.Handler(mainDomainSuffix, []byte(rawDomain),