use std::path::PathBuf;
#[derive(Debug, thiserror::Error)]
pub enum KnxprodError {
#[error("I/O error on {path}: {source}")]
Io {
path: PathBuf,
source: std::io::Error,
},
#[error("XML error: {0}")]
Xml(#[from] quick_xml::Error),
#[error("ZIP error: {0}")]
Zip(#[from] zip::result::ZipError),
#[error("missing required element: {0}")]
MissingElement(&'static str),
#[error("invalid XML structure: {0}")]
InvalidStructure(String),
}
impl KnxprodError {
pub fn io(path: impl Into<PathBuf>, source: std::io::Error) -> Self {
Self::Io {
path: path.into(),
source,
}
}
}