1use std::io;
2use thiserror::Error;
3
4pub type Result<T, E = Error> = std::result::Result<T, E>;
5
6#[derive(Debug, Error)]
7pub enum Error {
8 #[error("I/O error: {0}")]
9 Io(#[from] io::Error),
10
11 #[error("Not a Revit file (magic bytes did not match CFB/OLE)")]
12 NotACfbFile,
13
14 #[error("CFB: {0}")]
15 Cfb(String),
16
17 #[error("Stream not found: {0}")]
18 StreamNotFound(String),
19
20 #[error("Decompression failed: {0}")]
21 Decompress(String),
22
23 #[error("Decompression output limit exceeded: {0}")]
31 DecompressLimitExceeded(String),
32
33 #[error("Malformed BasicFileInfo: {0}")]
34 BasicFileInfo(String),
35
36 #[error("Malformed PartAtom XML: {0}")]
37 PartAtom(String),
38
39 #[error("Invalid UTF-16: {0}")]
40 Utf16(String),
41
42 #[error("operation cancelled by caller")]
46 Cancelled,
47}