1use std::path::PathBuf;
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5pub enum DuxError {
6 #[error("Path does not exist: {0}")]
7 PathNotFound(PathBuf),
8
9 #[error("Path is not a directory: {0}")]
10 NotADirectory(PathBuf),
11
12 #[error("Permission denied: {0}")]
13 PermissionDenied(PathBuf),
14
15 #[error("IO error: {0}")]
16 Io(#[from] std::io::Error),
17
18 #[error("Scan was cancelled")]
19 Cancelled,
20
21 #[error("Cache error: {0}")]
22 Cache(String),
23}
24
25pub type Result<T> = std::result::Result<T, DuxError>;