/ contexa / RUST / src / error.rs
Swadhin Biswas refactor(rust): rename crate from 'contexa' to 'cortexa' · 3/5/2026
ff86ca4
31 lines · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use thiserror::Error;

#[derive(Debug, Error)]
pub enum GCCError {
    #[error("GCC workspace already exists at {path}")]
    AlreadyExists { path: String },

    #[error("GCC workspace not found at {path}")]
    NotFound { path: String },

    #[error("Branch '{name}' already exists")]
    BranchExists { name: String },

    #[error("Branch '{name}' not found")]
    BranchNotFound { name: String },

    #[error("Failed to acquire lock: {0}")]
    Lock(String),

    #[error("Validation error: {0}")]
    Validation(String),

    #[error("IO error: {0}")]
    Io(#[from] std::io::Error),

    #[error("YAML parse error: {0}")]
    Yaml(#[from] serde_yaml::Error),
}

pub type Result<T> = std::result::Result<T, GCCError>;