use crate::id::FactId;
extern crate alloc;
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[non_exhaustive]
pub enum Error {
#[error("capacity exceeded: {what}")]
CapacityExceeded {
what: &'static str,
},
#[error("{what} too large: {len} bytes (max {max})")]
TooLarge {
what: &'static str,
len: usize,
max: usize,
},
#[error("vector dimension mismatch: got {got}, want {want}")]
DimMismatch {
got: usize,
want: usize,
},
#[error("fact {} not found", (.0).0)]
NotFound(FactId),
#[error("fact {} is already closed", (.0).0)]
AlreadyClosed(FactId),
#[error("config mismatch: {0}")]
ConfigMismatch(&'static str),
#[error("corrupt input: {0}")]
Corrupt(&'static str),
#[error("unsupported snapshot format version {0}")]
UnsupportedVersion(u16),
#[error("invalid input: {0}")]
Invalid(&'static str),
#[error("storage: {0}")]
Storage(alloc::string::String),
#[error("arena: {0}")]
Arena(#[from] plugmem_arena::Error),
}