Skip to content

Commit 33aa6f9

Browse files
authored
Log error and skip file when stat fails (#296)
1 parent 3c4a152 commit 33aa6f9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/sources/filesystem/filesystem.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ func (s *Source) Chunks(ctx context.Context, chunksChan chan *sources.Chunk) err
9696

9797
path := filepath.Join(cleanPath, relativePath)
9898

99-
fileStat, _ := os.Stat(path)
99+
fileStat, err := os.Stat(path)
100+
if err != nil {
101+
log.WithError(err).Warnf("unable to stat file: %s", path)
102+
}
100103
if !fileStat.Mode().IsRegular() {
101104
return nil
102105
}

0 commit comments

Comments
 (0)