Skip to main content

ooxml_pml/
error.rs

1//! Error types for PresentationML parsing and writing.
2
3use thiserror::Error;
4
5/// Errors that can occur when working with PPTX files.
6#[derive(Error, Debug)]
7pub enum Error {
8    /// Error from the OPC packaging layer.
9    #[error("OPC error: {0}")]
10    Opc(#[from] ooxml_opc::Error),
11
12    /// XML parsing error.
13    #[error("XML error: {0}")]
14    Xml(#[from] quick_xml::Error),
15
16    /// I/O error.
17    #[error("I/O error: {0}")]
18    Io(#[from] std::io::Error),
19
20    /// Invalid or malformed content.
21    #[error("Invalid content: {0}")]
22    Invalid(String),
23
24    /// Unsupported feature.
25    #[error("Unsupported feature: {0}")]
26    Unsupported(String),
27
28    /// XML serialization error.
29    #[error("Serialize error: {0}")]
30    Serialize(#[from] crate::generated_serializers::SerializeError),
31}
32
33/// Result type for PresentationML operations.
34pub type Result<T> = std::result::Result<T, Error>;