1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum KernelError {
6 #[error("LLM API error: {0}")]
8 LlmApi(String),
9
10 #[error("LLM rate limited: retry after {0}s")]
12 RateLimited(u64),
13
14 #[error("HTTP {status}: {message}")]
16 Http { status: u16, message: String },
17
18 #[error("Request timed out after {0}s")]
20 Timeout(u64),
21
22 #[error("Config error: {0}")]
24 Config(String),
25
26 #[error("Store error: {0}")]
28 Store(String),
29
30 #[error("Vault error: {0}")]
32 Vault(String),
33
34 #[error("IO error: {0}")]
36 Io(#[from] std::io::Error),
37
38 #[cfg(feature = "provider")]
40 #[error("Serialization error: {0}")]
41 Serialization(#[from] serde_json::Error),
42}
43
44pub type Result<T> = std::result::Result<T, KernelError>;