Skip to main content

xfa_layout_engine/
error.rs

1//! Layout engine error types.
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6/// Layout error.
7pub enum LayoutError {
8    #[error("No matching page area for layout state")]
9    /// No matching page area.
10    NoMatchingPageArea,
11
12    #[error("Content area overflow: cannot place content")]
13    /// Content area overflow.
14    ContentAreaOverflow,
15
16    #[error("Invalid measurement: {0}")]
17    /// Invalid measurement.
18    InvalidMeasurement(String),
19
20    #[error("Layout error: {0}")]
21    /// General error.
22    General(String),
23}
24
25/// Result type alias.
26pub type Result<T> = std::result::Result<T, LayoutError>;