use crate::memory::{MemoryKind, ScopeError};
#[derive(Debug, thiserror::Error)]
pub enum StoreError {
#[error("memory not found: {0}")]
NotFound(String),
#[error("invalid scope: {0}")]
InvalidScope(String),
#[error("edit not supported for memory {pid} with kind {kind:?}")]
UnsupportedEdit { pid: String, kind: MemoryKind },
#[error("database error: {0}")]
Database(#[from] sea_orm::DbErr),
#[error("cache invariant violated: {0}")]
CacheInvariant(String),
}
impl From<ScopeError> for StoreError {
fn from(err: ScopeError) -> Self {
Self::InvalidScope(err.to_string())
}
}