Skip to content

Commit

Permalink
Log the message and continue with next on error
Browse files Browse the repository at this point in the history
Signed-off-by: coni2k <coni2k@users.noreply.github.com>
  • Loading branch information
coni2k committed Aug 3, 2023
1 parent 4f3dc80 commit b022e0f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions cmd/criticality_score/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b022e0f

Please sign in to comment.