Skip to main content

sift_core/index/
error.rs

1use std::path::PathBuf;
2
3use super::trigram::TrigramIndexError;
4
5/// Errors specific to the index registry layer.
6#[derive(Debug, thiserror::Error)]
7pub enum IndexError {
8    #[error("invalid index layout: {path}")]
9    InvalidLayout { path: PathBuf },
10
11    #[error(transparent)]
12    Trigram(#[from] TrigramIndexError),
13
14    #[error("IO error inspecting index path {path}: {source}")]
15    Io {
16        path: PathBuf,
17        source: std::io::Error,
18    },
19
20    #[error("unknown index kind: {0}")]
21    UnknownIndexKind(String),
22
23    #[error("invalid snapshot manifest at {path}: {source}")]
24    InvalidManifest {
25        path: PathBuf,
26        source: serde_json::Error,
27    },
28}