1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum KernelError {
8 #[error("LLM API error: {0}")]
10 LlmApi(String),
11
12 #[error("LLM rate limited: retry after {0}s")]
14 RateLimited(u64),
15
16 #[error("HTTP {status}: {message}")]
18 Http {
19 status: u16,
21 message: String,
23 },
24
25 #[error("Request timed out after {0}s")]
27 Timeout(u64),
28
29 #[error("Config error: {0}")]
31 Config(String),
32
33 #[error("Store error: {0}")]
35 Store(String),
36
37 #[error("Vault error: {0}")]
39 Vault(String),
40
41 #[error("IO error: {0}")]
43 Io(#[from] std::io::Error),
44
45 #[error("Search error: {0}")]
47 Search(String),
48
49 #[cfg(feature = "provider")]
51 #[error("Serialization error: {0}")]
52 Serialization(#[from] serde_json::Error),
53}
54
55pub type Result<T> = std::result::Result<T, KernelError>;