1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum CrvError {
8 #[error("Dimension mismatch: expected {expected}, got {actual}")]
10 DimensionMismatch { expected: usize, actual: usize },
11
12 #[error("Invalid stage: {0} (must be 1-6)")]
14 InvalidStage(u8),
15
16 #[error("Empty input: {0}")]
18 EmptyInput(String),
19
20 #[error("Session not found: {0}")]
22 SessionNotFound(String),
23
24 #[error("Encoding error: {0}")]
26 EncodingError(String),
27
28 #[error("Attention error: {0}")]
30 AttentionError(#[from] ruvector_attention::AttentionError),
31
32 #[error("Serialization error: {0}")]
34 SerializationError(#[from] serde_json::Error),
35}
36
37pub type CrvResult<T> = Result<T, CrvError>;