1#[derive(Debug, thiserror::Error)]
3pub enum StorageError {
4 #[error("Failed to open database at {path}: {reason}")]
6 OpenError { path: String, reason: String },
7
8 #[error("Migration failed: {0}")]
10 MigrationError(String),
11
12 #[error("Query error: {0}")]
14 QueryError(String),
15
16 #[error("IR serialization error: {0}")]
18 SerializationError(String),
19
20 #[error("Stale IR: cached version {cached} != current version {current}")]
22 StaleIR { cached: u8, current: u8 },
23
24 #[error("{entity} not found: {id}")]
26 NotFound { entity: &'static str, id: String },
27
28 #[error("SQLite error: {0}")]
30 Sqlite(#[from] rusqlite::Error),
31
32 #[error("IO error: {0}")]
34 Io(#[from] std::io::Error),
35}