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