meritocrab_github/
error.rs1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum GithubError {
6 #[error("HMAC verification failed: {0}")]
7 HmacVerificationFailed(String),
8
9 #[error("Missing required header: {0}")]
10 MissingHeader(String),
11
12 #[error("Invalid signature format: {0}")]
13 InvalidSignatureFormat(String),
14
15 #[error("GitHub API error: {0}")]
16 ApiError(String),
17
18 #[error("Authentication error: {0}")]
19 AuthError(String),
20
21 #[error("JSON parsing error: {0}")]
22 JsonError(#[from] serde_json::Error),
23
24 #[error("Octocrab error: {0}")]
25 OctocrabError(#[from] octocrab::Error),
26}
27
28pub type GithubResult<T> = Result<T, GithubError>;