Skip to main content

file_engine/analysis/
error_strategy.rs

1/// How `AnalyzeBuilder::start()` handles a per-entry error mid-walk
2/// (e.g. a permission-denied subdirectory, or a symlink loop under
3/// `.follow_symlinks(true)`).
4///
5/// Deliberately a smaller enum than `planner::ErrorStrategy` rather than
6/// reusing it: analysis never writes anything, so `Undo` has no meaning
7/// here, and `ErrorStrategy` lives behind the `operations` feature,
8/// which `analyze` doesn't require.
9#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
10pub enum AnalysisErrorStrategy {
11    /// Skip the offending entry, record it in `AnalysisReport::errors`
12    /// (subject to the `max_reported_errors` cap), and keep walking.
13    #[default]
14    ContinueAndCollect,
15    /// Stop the walk and return the error from `.start()`'s `Handle`
16    /// the moment one is encountered.
17    AbortOnError,
18}