Skip to main content

cortexa_gcc/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum GCCError {
5    #[error("GCC workspace already exists at {path}")]
6    AlreadyExists { path: String },
7
8    #[error("GCC workspace not found at {path}")]
9    NotFound { path: String },
10
11    #[error("Branch '{name}' already exists")]
12    BranchExists { name: String },
13
14    #[error("Branch '{name}' not found")]
15    BranchNotFound { name: String },
16
17    #[error("Failed to acquire lock: {0}")]
18    Lock(String),
19
20    #[error("Validation error: {0}")]
21    Validation(String),
22
23    #[error("IO error: {0}")]
24    Io(#[from] std::io::Error),
25
26    #[error("YAML parse error: {0}")]
27    Yaml(#[from] serde_yaml::Error),
28}
29
30pub type Result<T> = std::result::Result<T, GCCError>;