Skip to main content

dumap_core/
error.rs

1use std::path::PathBuf;
2use thiserror::Error;
3
4/// Errors that occur during filesystem scanning
5#[derive(Debug, Error)]
6pub enum ScanError {
7    #[error("IO error reading {path}: {source}")]
8    Io {
9        path: PathBuf,
10        source: std::io::Error,
11    },
12
13    #[error("Scan cancelled by user")]
14    Cancelled,
15
16    #[error("Path does not exist: {0}")]
17    PathNotFound(PathBuf),
18
19    #[error("Path is not a directory: {0}")]
20    NotADirectory(PathBuf),
21
22    #[error("Serialization error: {0}")]
23    Serialization(String),
24}