1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, SQuaJLError>;
5
6#[derive(Debug, Error)]
8pub enum SQuaJLError {
9 #[error("invalid configuration: {0}")]
11 InvalidConfig(String),
12 #[error("dimension mismatch: expected {expected}, got {actual}")]
14 DimensionMismatch {
15 expected: usize,
17 actual: usize,
19 },
20 #[error("vector norm must be positive")]
22 ZeroNorm,
23 #[error("incompatible quantized vector: {0}")]
25 IncompatibleCode(String),
26 #[cfg(feature = "fastembed")]
28 #[error("backend error: {0}")]
29 Backend(String),
30}