use thiserror::Error;
#[derive(Error, Debug)]
pub enum ProcessorError {
#[error("Reference not found: {0}")]
ReferenceNotFound(String),
#[error("Date parse error: {0}")]
DateParseError(String),
#[error("Locale error: {0}")]
LocaleError(String),
#[error("Substitution error: {0}")]
SubstitutionError(String),
#[error("File I/O error: {0}")]
FileIO(#[from] std::io::Error),
#[error("Parse error ({0}): {1}")]
ParseError(String, String),
}
impl From<citum_refs::RefsError> for ProcessorError {
fn from(e: citum_refs::RefsError) -> Self {
match e {
citum_refs::RefsError::FileIO(io) => ProcessorError::FileIO(io),
citum_refs::RefsError::ParseError(name, msg) => ProcessorError::ParseError(name, msg),
}
}
}