Skip to main content

opensession_git_native/
error.rs

1use std::path::PathBuf;
2
3#[derive(Debug, thiserror::Error)]
4pub enum GitStorageError {
5    #[error("not a git repository: {0}")]
6    NotARepo(PathBuf),
7
8    #[error("git error: {0}")]
9    Gix(Box<dyn std::error::Error + Send + Sync>),
10
11    #[error("session not found: {0}")]
12    NotFound(String),
13
14    #[error("io error: {0}")]
15    Io(#[from] std::io::Error),
16
17    #[error("json error: {0}")]
18    Json(#[from] serde_json::Error),
19
20    #[error("{0}")]
21    Other(String),
22}
23
24pub type Result<T> = std::result::Result<T, GitStorageError>;