gitcc_git/
error.rs

1//! Git error
2
3#[derive(Debug, thiserror::Error)]
4#[error("git error: {0}")]
5pub struct Error(String);
6
7impl Error {
8    /// Cretes an [Error] from a string
9    pub fn msg(msg: &str) -> Self {
10        Self(msg.to_string())
11    }
12}
13
14impl From<git2::Error> for Error {
15    fn from(value: git2::Error) -> Self {
16        Error(value.message().to_string())
17    }
18}