prompt_store/api/
error.rs1use llm::error::LLMError;
4use thiserror::Error;
5
6#[derive(Error, Debug)]
8pub enum StoreError {
9 #[error("Failed to initialize store: {0}")]
11 Init(String),
12
13 #[error("Prompt or chain '{0}' not found")]
15 NotFound(String),
16
17 #[error("ID '{0}' is ambiguous (found both a prompt and a chain)")]
19 AmbiguousId(String),
20
21 #[error("Title '{0}' is ambiguous (multiple matches found)")]
23 AmbiguousTitle(String),
24
25 #[error("Configuration error: {0}")]
27 Configuration(String),
28
29 #[error("I/O error: {0}")]
31 Io(#[from] std::io::Error),
32
33 #[error("Crypto error: {0}")]
35 Crypto(String),
36
37 #[error("JSON parsing error: {0}")]
39 Json(#[from] serde_json::Error),
40}
41
42#[derive(Error, Debug)]
44pub enum RunError {
45 #[error(transparent)]
47 Store(#[from] StoreError),
48
49 #[error("LLM backend error: {0}")]
51 LLM(#[from] LLMError),
52}