1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, Error>;
7
8#[derive(Debug, Error)]
10pub enum Error {
11 #[error("API configuration not found: {0}")]
13 ConfigNotFound(String),
14
15 #[error("Failed to parse configuration: {0}")]
17 ConfigParse(#[from] serde_yaml::Error),
18
19 #[error("Invalid configuration: {0}")]
21 ConfigValidation(String),
22
23 #[error("Failed to resolve credential '{0}': {1}")]
25 Credential(String, String),
26
27 #[error("HTTP request failed: {0}")]
29 Http(#[from] reqwest::Error),
30
31 #[error("Template rendering failed: {0}")]
33 Template(#[from] tera::Error),
34
35 #[error("JSON error: {0}")]
37 Json(#[from] serde_json::Error),
38
39 #[error("IO error: {0}")]
41 Io(#[from] std::io::Error),
42
43 #[error("MCP error: {0}")]
45 Mcp(String),
46}