1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum MigrationError {
8 #[error("Authentication failed: {0}")]
10 AuthenticationFailed(String),
11
12 #[error("Repository not found: {0}")]
14 RepositoryNotFound(String),
15
16 #[error("Git clone failed: {0}")]
18 GitCloneFailed(String),
19
20 #[error("Git push failed: {0}")]
22 GitPushFailed(String),
23
24 #[error("API request failed: {0}")]
26 ApiError(String),
27
28 #[error("Rate limit exceeded, retry after {0} seconds")]
30 RateLimitExceeded(u64),
31
32 #[error("Network error: {0}")]
34 NetworkError(String),
35
36 #[error("Invalid configuration: {0}")]
38 InvalidConfig(String),
39
40 #[error("Verification failed: {0}")]
42 VerificationFailed(String),
43
44 #[error("Unsupported feature: {0}")]
46 UnsupportedFeature(String),
47
48 #[error("I/O error: {0}")]
50 IoError(#[from] std::io::Error),
51
52 #[error("JSON parsing error: {0}")]
54 JsonError(#[from] serde_json::Error),
55
56 #[error("HTTP error: {0}")]
58 HttpError(#[from] reqwest::Error),
59}
60
61pub type Result<T> = std::result::Result<T, MigrationError>;