use thiserror::Error;
use zip::result::ZipError;
#[derive(Debug, Error)]
pub enum Error {
#[error("I/O error while importing/exporting to 3MF file")]
Io(#[from] std::io::Error),
#[error("Error writing ZIP file (3MF files are ZIP files)")]
Zip(#[from] ZipError),
#[error("Error reading 3mf file: {0}")]
ReadError(String),
#[error("Error writing 3mf file: {0}")]
WriteError(String),
#[cfg(any(feature = "write", feature = "memory-optimized-read"))]
#[error("(De)Serialization error from Instant-Xml")]
InstantXmlError(#[from] instant_xml::Error),
#[error("Thumbnail error: {0}")]
ThumbnailError(String),
#[error("Resource not found: {0}")]
ResourceNotFound(String),
#[cfg(feature = "speed-optimized-read")]
#[error("Deserialization error from serde-roxmltree")]
SerdeRoxmltreeError(#[from] serde_roxmltree::Error),
}