1#[derive(Debug, thiserror::Error)]
8#[non_exhaustive]
9pub enum EnphaseError {
10 #[error("HTTP request failed: {0}")]
12 Http(#[from] reqwest::Error),
13
14 #[error("Invalid API response: {0}")]
16 InvalidResponse(String),
17
18 #[error("Authentication failed: {0}")]
20 AuthenticationFailed(String),
21
22 #[error("Configuration error: {0}")]
24 ConfigurationError(String),
25
26 #[error("I/O error: {0}")]
28 IoError(#[from] std::io::Error),
29
30 #[error("JSON parsing error: {0}")]
32 JsonError(#[from] serde_json::Error),
33}
34
35pub type Result<T> = core::result::Result<T, EnphaseError>;