use std::path::PathBuf;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum DciError {
#[error("invalid corpus root {path:?}: {reason}")]
InvalidRoot {
path: PathBuf,
reason: String,
},
#[error("path {requested:?} escapes the corpus root and was denied")]
PathEscape {
requested: String,
},
#[error("path {requested:?} was not found in the corpus")]
NotFound {
requested: String,
},
#[error("invalid search pattern: {0}")]
InvalidPattern(String),
#[error("invalid glob {glob:?}: {reason}")]
InvalidGlob {
glob: String,
reason: String,
},
#[error("operation timed out after {millis} ms")]
Timeout {
millis: u64,
},
#[error("i/o error on {path:?}: {source}")]
Io {
path: PathBuf,
#[source]
source: std::io::Error,
},
#[error("corpus worker task failed: {0}")]
Worker(String),
}
pub type Result<T> = std::result::Result<T, DciError>;