use std::path::PathBuf;
#[non_exhaustive]
#[derive(Debug, thiserror::Error)]
pub enum DetoxError {
#[error("rusty-detox: I/O error on '{path}': {source}")]
Io {
path: PathBuf,
#[source]
source: std::io::Error,
},
#[error("rusty-detox: config error at '{path}': {message}")]
Config {
path: PathBuf,
message: String,
},
#[error("rusty-detox: parse error at {path}:{line}:{column}: {message}")]
Parse {
path: PathBuf,
line: usize,
column: usize,
message: String,
},
#[error("rusty-detox: cannot resolve collision for '{path}' ({attempts} attempts)")]
Collision {
path: PathBuf,
attempts: u32,
},
#[error(
"rusty-detox: cross-device rename failed from '{source_path}' to '{target}': {source_err}"
)]
CrossDevice {
source_path: PathBuf,
target: PathBuf,
#[source]
source_err: std::io::Error,
},
#[error("rusty-detox: invalid path '{path}': {reason}")]
PathInvalid {
path: PathBuf,
reason: String,
},
}