From d5485181d3c1e9b86f405a507f12170d3890e23c Mon Sep 17 00:00:00 2001 From: Carmen de Lope Date: Wed, 7 Aug 2024 10:09:56 +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 b65dd6e3e..041e5bc63 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,