tinybase/
result.rs

1use thiserror::Error;
2use alloc::string::String;
3
4#[derive(Error, Debug)]
5pub enum TinyBaseError {
6    #[error("sled error")]
7    Sled(#[from] sled::Error),
8    #[error("serializer error")]
9    Serializer(#[from] bincode::Error),
10    #[error("record failed to match unique constraint")]
11    Exists { constraint: String, id: u64 },
12    #[error("a condition check was not met")]
13    Condition,
14    #[error("query builder error")]
15    QueryBuilder(String),
16    #[error("batch operation violates constraints")]
17    BatchOperationConstraints,
18}
19
20pub type DbResult<T> = Result<T, TinyBaseError>;