Break on not found error

This commit is contained in:
Gusted 2023-01-29 18:49:39 +01:00
parent e7e3045601
commit 001e89bb2e
No known key found for this signature in database
GPG Key ID: FD821B732837125F

View File

@ -36,7 +36,7 @@ func (o *Options) CheckCanonicalDomain(giteaClient *gitea.Client, actualDomain,
// Do at least three attempts before bailing out.
for i := 0; i < 3; i++ {
body, err = giteaClient.GiteaRawContent(o.TargetOwner, o.TargetRepo, o.TargetBranch, canonicalDomainConfig)
if err == nil {
if err == nil || err == gitea.ErrorNotFound {
break
}
@ -45,11 +45,7 @@ func (o *Options) CheckCanonicalDomain(giteaClient *gitea.Client, actualDomain,
continue
}
if err != gitea.ErrorNotFound {
log.Error().Err(err).Msgf("could not read %s of %s/%s", canonicalDomainConfig, o.TargetOwner, o.TargetRepo)
} else {
log.Info().Err(err).Msgf("could not read %s of %s/%s", canonicalDomainConfig, o.TargetOwner, o.TargetRepo)
}
log.Info().Err(err).Msgf("could not read %s of %s/%s", canonicalDomainConfig, o.TargetOwner, o.TargetRepo)
}
var domains []string