perfgate_github/error.rs
1//! Error types for the GitHub API client.
2
3/// Errors that can occur when interacting with the GitHub API.
4#[derive(Debug, thiserror::Error)]
5pub enum GitHubError {
6 /// Configuration error (e.g., invalid token).
7 #[error("GitHub configuration error: {0}")]
8 Config(String),
9
10 /// HTTP request error.
11 #[error("GitHub request error: {0}")]
12 Request(#[from] reqwest::Error),
13
14 /// GitHub API returned an error status code.
15 #[error("GitHub API error (HTTP {status}): {message}")]
16 Api {
17 /// HTTP status code.
18 status: u16,
19 /// Error message from the API.
20 message: String,
21 },
22}