xfa_layout_engine/error.rs
1//! Layout engine error types.
2
3// Copyright (c) 2026 Innovation Trigger B.V.
4//
5// PDFluent is available under two licences, at your option: the GNU AGPLv3, or
6// the PDFluent Commercial Licence. See the LICENSE file in this repository --
7// that file travels with the copy you received, which a URL does not.
8
9use thiserror::Error;
10
11#[derive(Debug, Error)]
12/// Layout error.
13pub enum LayoutError {
14 #[error("No matching page area for layout state")]
15 /// No matching page area.
16 NoMatchingPageArea,
17
18 #[error("Content area overflow: cannot place content")]
19 /// Content area overflow.
20 ContentAreaOverflow,
21
22 #[error("Invalid measurement: {0}")]
23 /// Invalid measurement.
24 InvalidMeasurement(String),
25
26 #[error("Layout error: {0}")]
27 /// General error.
28 General(String),
29}
30
31/// Result type alias.
32pub type Result<T> = std::result::Result<T, LayoutError>;