1use thiserror::Error;
10
11#[derive(Debug, Error)]
12pub enum TensogramError {
13 #[error("framing error: {0}")]
14 Framing(String),
15 #[error("metadata error: {0}")]
16 Metadata(String),
17 #[error("encoding error: {0}")]
18 Encoding(String),
19 #[error("compression error: {0}")]
20 Compression(String),
21 #[error("object error: {0}")]
22 Object(String),
23 #[error("io error: {0}")]
24 Io(#[from] std::io::Error),
25 #[error("hash mismatch: expected {expected}, got {actual}")]
26 HashMismatch { expected: String, actual: String },
27 #[error("remote error: {0}")]
28 Remote(String),
29}
30
31pub type Result<T> = std::result::Result<T, TensogramError>;