Skip to main content

boox_note_parser/
error.rs

1pub type Result<T = ()> = std::result::Result<T, Error>;
2
3#[derive(Debug, thiserror::Error)]
4pub enum Error {
5    #[error("Invalid container format")]
6    InvalidContainerFormat,
7    #[error("Invalid archive entry name: {0}")]
8    InvalidArchiveEntryName(String),
9    #[error("I/O error: {0}")]
10    Io(#[from] std::io::Error),
11    #[error("JSON error: {error} in JSON string: {json_string}")]
12    Json {
13        error: serde_json::Error,
14        json_string: String,
15    },
16    #[error("Zip error: {0}")]
17    Zip(#[from] zip::result::ZipError),
18    #[error("Protobuf decode error: {0}")]
19    ProtobufDecode(#[from] prost::DecodeError),
20    #[error("UUID parse error: {0}")]
21    UuidParse(#[from] uuid::Error),
22    #[error("UUID invalid UTF8: {0}")]
23    UuidInvalidUtf8(std::str::Utf8Error),
24    #[error("Invalid timestamp: {0}")]
25    InvalidTimestamp(u64),
26    #[error("Invalid timestamp format: {0}")]
27    InvalidTimestampFormat(String),
28    #[error("Stroke not found")]
29    StrokeNotFound,
30}