elizaos_plugin_copilot_proxy/
error.rs1use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum CopilotProxyError {
8 #[error("HTTP request failed: {0}")]
10 HttpError(#[from] reqwest::Error),
11
12 #[error("JSON error: {0}")]
14 JsonError(#[from] serde_json::Error),
15
16 #[error("Copilot Proxy API error ({status}): {message}")]
18 ApiError {
19 status: u16,
21 message: String,
23 },
24
25 #[error("Invalid configuration: {0}")]
27 ConfigError(String),
28
29 #[error("API returned empty response")]
31 EmptyResponse,
32
33 #[error("URL parsing error: {0}")]
35 UrlError(#[from] url::ParseError),
36
37 #[error("Failed to extract JSON: {0}")]
39 JsonExtractionError(String),
40
41 #[error("Request timed out after {0} seconds")]
43 Timeout(u64),
44
45 #[error("Plugin is disabled")]
47 Disabled,
48}
49
50pub type Result<T> = std::result::Result<T, CopilotProxyError>;