diff --git a/pkg/sources/errors.go b/pkg/sources/errors.go index 3ec62a74d6af..123241b34356 100644 --- a/pkg/sources/errors.go +++ b/pkg/sources/errors.go @@ -2,7 +2,7 @@ package sources import ( "errors" - "fmt" + "strings" "sync" ) @@ -35,7 +35,17 @@ func (s *ScanErrors) Count() uint64 { func (s *ScanErrors) String() string { s.mu.RLock() defer s.mu.RUnlock() - return fmt.Sprintf("%v", s.errors) + + var sb strings.Builder + sb.WriteString("[") + for i, err := range s.errors { + sb.WriteString(`"` + err.Error() + `"`) + if i < len(s.errors)-1 { + sb.WriteString(", ") + } + } + sb.WriteString("]") + return sb.String() } func (s *ScanErrors) Errors() error { diff --git a/pkg/sources/github/github.go b/pkg/sources/github/github.go index 7972e562d00e..9ad9e2099d0c 100644 --- a/pkg/sources/github/github.go +++ b/pkg/sources/github/github.go @@ -748,7 +748,7 @@ func (s *Source) scan(ctx context.Context, installationClient *github.Client, ch _ = s.jobPool.Wait() if scanErrs.Count() > 0 { - s.log.V(0).Info("failed to scan some repositories", "error_count", scanErrs.Count(), "errors", scanErrs) + s.log.V(0).Info("failed to scan some repositories", "error_count", scanErrs.Count(), "errors", scanErrs.String()) } s.SetProgressComplete(len(s.repos), len(s.repos), "Completed GitHub scan", "")