mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 10:32:19 +00:00
xml: Move Error to own module
This commit is contained in:
25
crates/xml/src/error.rs
Normal file
25
crates/xml/src/error.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum XmlDeError {
|
||||
#[error(transparent)]
|
||||
QuickXmlError(#[from] quick_xml::Error),
|
||||
#[error(transparent)]
|
||||
QuickXmlAttrError(#[from] quick_xml::events::attributes::AttrError),
|
||||
#[error("Unknown error")]
|
||||
UnknownError,
|
||||
#[error("Invalid tag [{0}]{1}. Expected [{2}]{3}")]
|
||||
InvalidTag(String, String, String, String),
|
||||
#[error("Missing field {0}")]
|
||||
MissingField(&'static str),
|
||||
#[error("End of file, expected closing tags")]
|
||||
Eof,
|
||||
#[error("Unsupported xml event: {0}")]
|
||||
UnsupportedEvent(&'static str),
|
||||
#[error("Invalid variant: {0}")]
|
||||
InvalidVariant(String),
|
||||
#[error("Invalid field name in {0}: {1}")]
|
||||
InvalidFieldName(&'static str, String),
|
||||
#[error(transparent)]
|
||||
InvalidValue(#[from] crate::value::ParseValueError),
|
||||
}
|
||||
Reference in New Issue
Block a user