1use thiserror::Error;
7
8#[derive(Error, Debug)]
10pub enum ProcessorError {
11 #[error("Reference not found: {0}")]
13 ReferenceNotFound(String),
14
15 #[error("Date parse error: {0}")]
17 DateParseError(String),
18
19 #[error("Locale error: {0}")]
21 LocaleError(String),
22
23 #[error("Substitution error: {0}")]
25 SubstitutionError(String),
26
27 #[error("File I/O error: {0}")]
29 FileIO(#[from] std::io::Error),
30
31 #[error("Parse error ({0}): {1}")]
33 ParseError(String, String),
34}
35
36impl From<citum_refs::RefsError> for ProcessorError {
37 fn from(e: citum_refs::RefsError) -> Self {
38 match e {
39 citum_refs::RefsError::FileIO(io) => ProcessorError::FileIO(io),
40 citum_refs::RefsError::ParseError(name, msg) => ProcessorError::ParseError(name, msg),
41 }
42 }
43}