Fix StoreId::exists() usage
This commit is contained in:
parent
111943e0eb
commit
c2838cca3b
1 changed files with 12 additions and 7 deletions
|
@ -68,20 +68,25 @@ impl HookDataAccessorProvider for LinkedEntriesExistHook {
|
||||||
impl NonMutableHookDataAccessor for LinkedEntriesExistHook {
|
impl NonMutableHookDataAccessor for LinkedEntriesExistHook {
|
||||||
|
|
||||||
fn access(&self, fle: &FileLockEntry) -> HookResult<()> {
|
fn access(&self, fle: &FileLockEntry) -> HookResult<()> {
|
||||||
|
use libimagstore::hook::error::HookErrorKind;
|
||||||
|
use libimagstore::hook::error::MapErrInto;
|
||||||
|
|
||||||
debug!("[LINKVERIFY HOOK] {:?}", fle.get_location());
|
debug!("[LINKVERIFY HOOK] {:?}", fle.get_location());
|
||||||
let _ = fle.get_internal_links()
|
match fle.get_internal_links() {
|
||||||
.map(|links| {
|
Ok(links) => {
|
||||||
for link in links {
|
for link in links {
|
||||||
if !link.exists() {
|
if !try!(link.exists().map_err_into(HookErrorKind::HookExecutionError)) {
|
||||||
warn!("File link does not exist: {:?} -> {:?}", fle.get_location(), link);
|
warn!("File link does not exist: {:?} -> {:?}", fle.get_location(), link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
Ok(())
|
||||||
.map_err(|e| {
|
},
|
||||||
|
Err(e) => {
|
||||||
warn!("Couldn't execute Link-Verify hook");
|
warn!("Couldn't execute Link-Verify hook");
|
||||||
trace_error(&e);
|
trace_error(&e);
|
||||||
});
|
Err(e).map_err_into(HookErrorKind::HookExecutionError)
|
||||||
Ok(())
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue