1use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum AiError {
7 #[error("Evaluation failed: {0}")]
8 EvaluationFailed(String),
9
10 #[error("Verification failed: {0}")]
11 VerificationFailed(String),
12
13 #[error("Validation error: {0}")]
14 Validation(String),
15
16 #[error("LLM provider error: {0}")]
17 ProviderError(String),
18
19 #[error("Rate limit exceeded")]
20 RateLimitExceeded,
21
22 #[error("No LLM provider configured")]
23 NoProviderConfigured,
24
25 #[error("Service unavailable")]
26 ServiceUnavailable,
27
28 #[error("GitHub API error: {0}")]
29 GitHub(String),
30
31 #[error("Internal error: {0}")]
32 Internal(String),
33
34 #[error("Parse error: {0}")]
35 ParseError(String),
36
37 #[error("Invalid input: {0}")]
38 InvalidInput(String),
39
40 #[error("Configuration error: {0}")]
41 Configuration(String),
42
43 #[error("Service unavailable: {0}")]
44 Unavailable(String),
45
46 #[error("Quota exceeded: {0}")]
47 QuotaExceeded(String),
48
49 #[error("Feature not available: {0}")]
50 FeatureNotAvailable(String),
51
52 #[error("Limit exceeded: {0}")]
53 LimitExceeded(String),
54
55 #[error("Not found: {0}")]
56 NotFound(String),
57}
58
59pub type Result<T> = std::result::Result<T, AiError>;