1pub type Result<T> = std::result::Result<T, Error>;
5
6#[derive(Debug, thiserror::Error)]
8pub enum Error {
9 #[error("GitHub authentication failed - run `gh auth login` or set GITHUB_TOKEN")]
11 AuthenticationFailed,
12
13 #[error("no GitHub token found - run `gh auth login` or set GITHUB_TOKEN")]
15 NoToken,
16
17 #[error("GitHub API rate limit exceeded - wait and try again")]
19 RateLimited,
20
21 #[error("repository not found or no access: {0}")]
23 RepoNotFound(String),
24
25 #[error("pull request not found: #{0}")]
27 PrNotFound(u64),
28
29 #[error("GitHub API error ({status}): {message}")]
31 ApiError { status: u16, message: String },
32
33 #[error("network error: {0}")]
35 Network(#[from] reqwest::Error),
36
37 #[error("failed to parse GitHub response: {0}")]
39 Parse(#[from] serde_json::Error),
40
41 #[error("io error: {0}")]
43 Io(#[from] std::io::Error),
44}