Add more detailed errors

This commit is contained in:
Matthias Beyer 2016-10-07 14:07:17 +02:00
parent fb475784be
commit e92fe89270
2 changed files with 3 additions and 0 deletions

View file

@ -40,6 +40,7 @@ generate_error_module!(
RepositoryPathAddingError => "Error while adding Path to Index",
RepositoryCommittingError => "Error while committing",
RepositoryParentFetchingError => "Error while fetching parent of commit",
RepositoryStatusFetchError => "Error while fetching repository status",
HeadFetchError => "Error while getting HEAD",
NotOnBranch => "No Branch is checked out",

View file

@ -160,6 +160,7 @@ impl StoreIdAccessor for StoreUnloadHook {
})
.any(|s| s == new || s == modif || s == del || s == ren)
})
.map_err_into(GHEK::RepositoryStatusFetchError)
.map_err_into(GHEK::RepositoryError)
.map_into_hook_error()
};
@ -168,6 +169,7 @@ impl StoreIdAccessor for StoreUnloadHook {
if add_wt_changes_before_committing(cfg) {
debug!("Adding WT changes before committing.");
try!(index.add_all(&["*"], ADD_DEFAULT, None)
.map_err_into(GHEK::RepositoryPathAddingError)
.map_err_into(GHEK::RepositoryError)
.map_into_hook_error());
} else {