1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! Structured error type.
//!
//! Errors are split into two paths, per the "graceful degradation" principle:
//!
//! - **Fatal** — the document cannot be parsed at all (bad container, wrong
//! password, structurally broken). These return `Err(PdfmuseError)`.
//! - **Degradable** — a single page/object is damaged, a font lacks a CMap, a
//! page needs OCR, etc. These do **not** error; they are recorded in
//! [`crate::ir::Document::warnings`] and parsing continues.
//!
//! The core never `panic!`s on malformed input — every failure surfaces as one
//! of these two. Bindings map `PdfmuseError` onto each language's exception type.
use Error;
/// Convenience alias used throughout the crate and by the public API.
pub type Result<T> = Result;
/// A fatal parsing error. Non-fatal degradations use
/// [`crate::ir::Warning`] instead.