use crate::parser::errors::{XmlInspectionError, XmlParseError};
use crate::protocol::errors::{InvalidValueParseError, TypeParseError, UnitsError, ValueError};
pub type Result<T> = core::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("inspection error: {0:?}")]
Inspection(#[from] XmlInspectionError),
#[error("XML parse error: {0:?}")]
Parse(#[from] XmlParseError),
#[error("incorrect units: {0:?}")]
Units(#[from] UnitsError),
#[error("incorrect value specs: {0:?}")]
Value(#[from] ValueError),
#[error("incorrect invalid value specs: {0:?}")]
InvalidValue(#[from] InvalidValueParseError),
#[error("incorrect type specs: {0:?}")]
Type(#[from] TypeParseError),
#[error("IO error: {0:?}")]
Io(#[from] std::io::Error),
}