1use thiserror::Error;
2
3#[derive(Error, Debug)]
5pub enum IndexError {
6 #[error("Database error: {0}")]
7 Database(#[from] sqlite::Error),
8
9 #[error("Serialization error: {0}")]
10 Serialization(#[from] serde_json::Error),
11
12 #[error("Git error: {0}")]
13 Git(#[from] git2::Error),
14
15 #[error("IO error: {0}")]
16 Io(#[from] std::io::Error),
17
18 #[error("Index not found at path: {0}")]
19 NotFound(String),
20
21 #[error("Invalid attestation data: {0}")]
22 InvalidData(String),
23}
24
25pub type Result<T> = std::result::Result<T, IndexError>;