#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("commit conflict: {0}")]
CommitConflict(String),
#[error("corruption: {0}")]
Corruption(String),
#[error("not found: {0}")]
NotFound(String),
#[error("already exists: {0}")]
AlreadyExists(String),
#[error("constraint violation: {0}")]
Constraint(String),
#[error("index building: {0}")]
IndexBuilding(String),
#[error("configuration: {0}")]
Configuration(String),
#[error("store error")]
Store(#[source] Box<slatedb::Error>),
}
impl From<slatedb::Error> for Error {
fn from(err: slatedb::Error) -> Self {
Self::Store(Box::new(err))
}
}
pub type Result<T> = std::result::Result<T, Error>;