xml_include/
error.rs

1use thiserror::Error;
2
3pub(crate) type Result<T> = std::result::Result<T, IncludeError>;
4
5#[derive(Error, Debug)]
6pub enum IncludeError {
7    #[error("IO error: {0}")]
8    IoError(#[from] std::io::Error),
9    #[error("UTF-8 error: {0}")]
10    Utf8Error(#[from] std::string::FromUtf8Error),
11    #[error("XML writer error: {0}")]
12    XmlWriteError(#[from] xml::writer::Error),
13    #[error("XML reader error: {0}")]
14    XmlReadError(#[from] xml::reader::Error),
15    #[error("XML reference error: {0}")]
16    XmlReferenceError(&'static str),
17}