Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit fd195f0

Browse files
author
Patrick Thomson
committed
Don't treat failures as errors when iterating over source entries.
1 parent 33c9e7f commit fd195f0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tree-sitter-stack-graphs/src/cli/analyze.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,15 @@ impl AnalyzeArgs {
7777
.filter(|e| e.file_type().is_file())
7878
{
7979
let source_path = source_entry.path();
80-
self.analyze_file_with_context(source_root, source_path, loader)?;
80+
if let Err(e) = self.analyze_file_with_context(source_root, source_path, loader) {
81+
eprintln!("Skipping file {} due to analysis failure {}", source_path.display(), e.to_string());
82+
}
8183
}
8284
} else {
8385
let source_root = source_path.parent().unwrap();
84-
self.analyze_file_with_context(source_root, source_path, loader)?;
86+
if let Err(e) = self.analyze_file_with_context(source_root, source_path, loader) {
87+
eprintln!("Skipping file {} due to analysis failure {}", source_path.display(), e.to_string());
88+
};
8589
}
8690
}
8791
Ok(())

0 commit comments

Comments
 (0)