use std::fmt;
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum PathError {
PathTraversal(String),
InvalidCharacter(String),
OutsideBounds,
}
impl fmt::Display for PathError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
PathError::PathTraversal(p) => write!(f, "Path contains traversal pattern: {}", p),
PathError::InvalidCharacter(p) => write!(f, "Path contains invalid characters: {}", p),
PathError::OutsideBounds => write!(f, "Path is outside expected bounds"),
}
}
}
impl std::error::Error for PathError {}