From 6ce409cd56e64b20234f69adf81645ceefb7b7af Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Tue, 11 Oct 2022 14:20:24 +1100 Subject: [PATCH] Prevent errors from stopping scan --- pkg/file/scan.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/file/scan.go b/pkg/file/scan.go index df88505ef..7adcd4d9b 100644 --- a/pkg/file/scan.go +++ b/pkg/file/scan.go @@ -197,7 +197,9 @@ func (s *scanJob) queueFiles(ctx context.Context, paths []string) error { func (s *scanJob) queueFileFunc(ctx context.Context, f FS, zipFile *scanFile) fs.WalkDirFunc { return func(path string, d fs.DirEntry, err error) error { if err != nil { - return err + // don't let errors prevent scanning + logger.Errorf("error scanning %s: %v", path, err) + return nil } if err = ctx.Err(); err != nil {