Add GitHookError::inside_if()
This commit is contained in:
parent
189ebb2aea
commit
830d170518
1 changed files with 12 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
use libimagstore::hook::error::HookError as HE;
|
||||||
|
use libimagstore::hook::error::HookErrorKind as HEK;
|
||||||
|
use libimagstore::hook::result::HookResult;
|
||||||
|
|
||||||
generate_error_module!(
|
generate_error_module!(
|
||||||
generate_error_types!(GitHookError, GitHookErrorKind,
|
generate_error_types!(GitHookError, GitHookErrorKind,
|
||||||
ConfigError => "Configuration Error",
|
ConfigError => "Configuration Error",
|
||||||
|
@ -19,6 +23,14 @@ generate_error_module!(
|
||||||
);
|
);
|
||||||
);
|
);
|
||||||
|
|
||||||
|
impl GitHookError {
|
||||||
|
|
||||||
|
pub fn inside_of<T>(self, h: HEK) -> HookResult<T> {
|
||||||
|
Err(HE::new(h, Some(Box::new(self))))
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
pub use self::error::GitHookError;
|
pub use self::error::GitHookError;
|
||||||
pub use self::error::GitHookErrorKind;
|
pub use self::error::GitHookErrorKind;
|
||||||
pub use self::error::MapErrInto;
|
pub use self::error::MapErrInto;
|
||||||
|
|
Loading…
Reference in a new issue