docx_reader/reader/
errors.rs

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
use thiserror::Error;

#[derive(Error, Debug)]
pub enum ReaderError {
	#[error("Failed to read from zip.")]
	ZipError(#[from] zip::result::ZipError),
	#[error("Failed to parse int.")]
	NumError(#[from] std::num::ParseIntError),
	#[error("Failed to parse float.")]
	FloatError(#[from] std::num::ParseFloatError),
	#[error("Failed to convert type.")]
	TypeError(#[from] crate::types::TypeError),
	#[error("Failed to read xml.")]
	XMLReadError,
	#[error("Failed to find document.")]
	DocumentNotFoundError,
	#[error("Failed to find document rels.")]
	DocumentRelsNotFoundError,
	#[error("Failed to find styles.")]
	DocumentStylesNotFoundError,
	#[error("Failed to find numberings.")]
	DocumentNumberingsNotFoundError,
	#[error("Unknown error")]
	Unknown,
}