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
44
45
46
47
use std::io;
use thiserror::Error;
pub type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(Debug, Error)]
pub enum Error {
#[error("I/O error: {0}")]
Io(#[from] io::Error),
#[error("Not a Revit file (magic bytes did not match CFB/OLE)")]
NotACfbFile,
#[error("CFB: {0}")]
Cfb(String),
#[error("Stream not found: {0}")]
StreamNotFound(String),
#[error("Decompression failed: {0}")]
Decompress(String),
/// A bounded-decompression call refused to continue because its
/// output budget would be exceeded. Raised by
/// [`crate::compression::inflate_at_with_limits`] and its
/// aggregate-budget cousin. Distinct from the generic
/// `Decompress` variant so callers can distinguish "corrupt
/// input" from "well-formed input that would inflate beyond the
/// configured DoS ceiling."
#[error("Decompression output limit exceeded: {0}")]
DecompressLimitExceeded(String),
#[error("Malformed BasicFileInfo: {0}")]
BasicFileInfo(String),
#[error("Malformed PartAtom XML: {0}")]
PartAtom(String),
#[error("Invalid UTF-16: {0}")]
Utf16(String),
/// A caller-supplied [`crate::control::CancelToken`] was cancelled
/// while a scan was running. Partial results are discarded; the
/// file itself is fine.
#[error("operation cancelled by caller")]
Cancelled,
}