use std::fmt;
#[derive(Debug, Clone, PartialEq)]
pub enum FormatError {
FormatNotFound(String),
ParseError(String),
SerializationError(String),
NotSupported(String),
}
impl fmt::Display for FormatError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
FormatError::FormatNotFound(name) => write!(f, "Format '{name}' not found"),
FormatError::ParseError(msg) => write!(f, "Parse error: {msg}"),
FormatError::SerializationError(msg) => write!(f, "Serialization error: {msg}"),
FormatError::NotSupported(msg) => write!(f, "Operation not supported: {msg}"),
}
}
}
impl std::error::Error for FormatError {}