Simplify error creating code snippet, as we have From<> now implemented
This commit is contained in:
parent
e5a066ed0b
commit
989c1790be
1 changed files with 3 additions and 7 deletions
|
@ -70,16 +70,12 @@ impl Runtime {
|
||||||
let head = try!(self
|
let head = try!(self
|
||||||
.repository()
|
.repository()
|
||||||
.and_then(|r| {
|
.and_then(|r| {
|
||||||
r.head().map_err_into(GHEK::HeadFetchError)
|
r.head().map_err_into(GHEK::HeadFetchError).map_err(|e| e.into())
|
||||||
})
|
}));
|
||||||
.map_err(Box::new)
|
|
||||||
.map_err(|e| HEK::HookExecutionError.into_error_with_cause(e)));
|
|
||||||
|
|
||||||
// TODO: Fail if not on branch? hmmh... I'm not sure
|
// TODO: Fail if not on branch? hmmh... I'm not sure
|
||||||
if head.is_branch() {
|
if head.is_branch() {
|
||||||
return Err(GHEK::NotOnBranch.into_error())
|
return Err(GHEK::NotOnBranch.into_error().into());
|
||||||
.map_err(Box::new)
|
|
||||||
.map_err(|e| HEK::HookExecutionError.into_error_with_cause(e));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check out appropriate branch ... or fail
|
// Check out appropriate branch ... or fail
|
||||||
|
|
Loading…
Reference in a new issue