From 74b0268ea48dd714617311d2b1868b663c01b45a Mon Sep 17 00:00:00 2001 From: coni2k Date: Thu, 3 Aug 2023 13:37:00 +0200 Subject: [PATCH] Log the message and continue with next on error --- cmd/criticality_score/main.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/cmd/criticality_score/main.go b/cmd/criticality_score/main.go index 31ce72572..e201f96a0 100644 --- a/cmd/criticality_score/main.go +++ b/cmd/criticality_score/main.go @@ -203,21 +203,26 @@ func main() { for u := range repos { l := innerLogger.With(zap.String("url", u.String())) ss, err := c.Collect(ctx, u, "") + extras := []signalio.Field{} if err != nil { if errors.Is(err, collector.ErrUncollectableRepo) { l.With( zap.Error(err), ).Warn("Repo cannot be collected") - return + } else { + l.With( + zap.Error(err), + ).Error("Failed to collect signals for repo") } - l.With( - zap.Error(err), - ).Error("Failed to collect signals for repo") - os.Exit(1) // TODO: pass up the error + + repoUrl := signalio.Field{ + Key: "repo.url", + Value: u.String(), + } + extras = append(extras, repoUrl) } // If scoring is enabled, prepare the extra data to be output. - extras := []signalio.Field{} if s != nil { f := signalio.Field{ Key: scoreColumnName,