1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum GnError {
5 #[error("Git error: {0}")]
6 Git(String),
7 #[error("Not found: {0}")]
8 NotFound(String),
9 #[error("Invalid namespace: {0}")]
10 InvalidNamespace(String),
11 #[error("IO error: {0}")]
12 Io(#[from] std::io::Error),
13 #[error("JSON error: {0}")]
14 Json(#[from] serde_json::Error),
15 #[error("Invalid UTF-8: {0}")]
16 InvalidUtf8(#[from] std::string::FromUtf8Error),
17}
18
19pub type Result<T> = std::result::Result<T, GnError>;