git2_hooks/error.rs
1use thiserror::Error;
2
3/// crate specific error type
4#[derive(Error, Debug)]
5pub enum HooksError {
6 #[error("git error:{0}")]
7 Git(#[from] git2::Error),
8
9 #[error("io error:{0}")]
10 Io(#[from] std::io::Error),
11
12 #[error("path string conversion error")]
13 PathToString,
14
15 #[error("shellexpand error:{0}")]
16 ShellExpand(#[from] shellexpand::LookupError<std::env::VarError>),
17}
18
19/// crate specific `Result` type
20pub type Result<T> = std::result::Result<T, HooksError>;