use thiserror::Error;
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum CleanshError {
#[error("Failed to compile redaction rule '{0}': {1}")]
RuleCompilationError(String, regex::Error),
#[error("Rule '{0}': pattern length ({1}) exceeds maximum allowed ({2})")]
PatternLengthExceeded(String, usize, usize),
#[error("Failed to serialize configuration for hashing: {0}")]
SerializationError(String),
#[error("An unexpected I/O error occurred: {0}")]
IoError(#[from] std::io::Error),
#[error("A critical system error occurred: {0}")]
AnyhowWrapper(#[from] anyhow::Error),
#[error("A fatal error occurred: {0}")]
Fatal(String),
}