Skip to main content

ringdb/
error.rs

1/// All errors that ringdb can produce.
2#[derive(Debug, thiserror::Error)]
3pub enum RingDbError {
4    #[error("dimension mismatch: expected {expected}, got {got}")]
5    DimensionMismatch { expected: usize, got: usize },
6
7    #[error("payload serialization error: {0}")]
8    Payload(String),
9
10    #[error("io error: {0}")]
11    Io(#[from] std::io::Error),
12
13    #[error("corrupt database: {0}")]
14    Corrupt(String),
15}
16
17pub type Result<T> = std::result::Result<T, RingDbError>;