diff --git a/libimagstorestdhook/src/vcs/git/error.rs b/libimagstorestdhook/src/vcs/git/error.rs index 0af7b0ab..f7ce2cb6 100644 --- a/libimagstorestdhook/src/vcs/git/error.rs +++ b/libimagstorestdhook/src/vcs/git/error.rs @@ -1,3 +1,5 @@ +use git2::Error as Git2Error; + use libimagstore::hook::error::HookError as HE; use libimagstore::hook::error::HookErrorKind as HEK; use libimagstore::hook::result::HookResult; @@ -8,6 +10,7 @@ generate_error_module!( NoConfigError => "No Configuration", ConfigTypeError => "Configuration value type wrong", RuntimeInformationSetupError => "Couldn't setup runtime information for git hook", + RepositoryBackendError => "Error in the git library", RepositoryError => "Error while interacting with git repository", RepositoryBranchError => "Error while interacting with git branch(es)", RepositoryBranchNameFetchingError => "Error while fetching branch name", @@ -41,6 +44,14 @@ impl From for HE { } +impl From for GitHookError { + + fn from(ge: Git2Error) -> GitHookError { + GitHookError::new(GitHookErrorKind::RepositoryBackendError, Some(Box::new(ge))) + } + +} + pub use self::error::GitHookError; pub use self::error::GitHookErrorKind; pub use self::error::MapErrInto;