1use crate::vectordb::VectorDbError;
2use thiserror::Error;
3
4#[derive(Debug, Error)]
5pub enum L2CacheError {
7 #[error("embedding generation failed: {reason}")]
9 EmbeddingFailed {
10 reason: String,
12 },
13
14 #[error("vector database error: {0}")]
16 VectorDb(#[from] VectorDbError),
17
18 #[error("rescoring failed: {reason}")]
20 RescoringFailed {
21 reason: String,
23 },
24
25 #[error("configuration error: {reason}")]
27 ConfigError {
28 reason: String,
30 },
31
32 #[error("no candidates found for query")]
34 NoCandidates,
35}
36
37pub type L2CacheResult<T> = Result<T, L2CacheError>;