1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum InnateError {
5 #[error("SQLite error: {0}")]
6 Db(#[from] rusqlite::Error),
7
8 #[error("JSON error: {0}")]
9 Json(#[from] serde_json::Error),
10
11 #[error("Embedding unavailable: {0}")]
12 EmbeddingUnavailable(String),
13
14 #[error("Chunk not found: {0}")]
15 ChunkNotFound(String),
16
17 #[error("Invalid state transition: {0}")]
18 InvalidState(String),
19
20 #[error(
21 "Outcome conflict: trace {trace_id} already has outcome {existing}, cannot set {requested}"
22 )]
23 OutcomeConflict {
24 trace_id: String,
25 existing: String,
26 requested: String,
27 },
28
29 #[error("IO error: {0}")]
30 Io(#[from] std::io::Error),
31
32 #[error("{0}")]
33 Other(String),
34}
35
36pub type Result<T> = std::result::Result<T, InnateError>;