memoir_core/store/
error.rs1use crate::memory::{MemoryKind, ScopeError};
2
3#[derive(Debug, thiserror::Error)]
5pub enum StoreError {
6 #[error("memory not found: {0}")]
7 NotFound(String),
8
9 #[error("invalid scope: {0}")]
10 InvalidScope(String),
11
12 #[error("edit not supported for memory {pid} with kind {kind:?}")]
18 UnsupportedEdit { pid: String, kind: MemoryKind },
19
20 #[error("database error: {0}")]
21 Database(#[from] sea_orm::DbErr),
22
23 #[error("cache invariant violated: {0}")]
24 CacheInvariant(String),
25}
26
27impl From<ScopeError> for StoreError {
28 fn from(err: ScopeError) -> Self {
29 Self::InvalidScope(err.to_string())
30 }
31}