1use std::path::PathBuf;
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
11pub enum GitCortexError {
12 #[error("parse error in {file}: {message}")]
13 Parse { file: PathBuf, message: String },
14
15 #[error("git error: {0}")]
17 Git(String),
18
19 #[error("store error: {0}")]
21 Store(String),
22
23 #[error("io error: {0}")]
24 Io(#[from] std::io::Error),
25
26 #[error("branch '{branch}' not found in store")]
27 BranchNotFound { branch: String },
28
29 #[error("config error: {0}")]
30 Config(String),
31}
32
33pub type Result<T> = std::result::Result<T, GitCortexError>;