Add more error levels in hook execution error wrapping
This commit is contained in:
parent
5a4e6b4af6
commit
8de32622b9
1 changed files with 15 additions and 4 deletions
|
@ -323,6 +323,7 @@ impl Store {
|
||||||
if let Err(e) = self.execute_hooks_for_id(self.pre_create_aspects.clone(), &id) {
|
if let Err(e) = self.execute_hooks_for_id(self.pre_create_aspects.clone(), &id) {
|
||||||
return Err(e)
|
return Err(e)
|
||||||
.map_err_into(SEK::PreHookExecuteError)
|
.map_err_into(SEK::PreHookExecuteError)
|
||||||
|
.map_err_into(SEK::HookExecutionError)
|
||||||
.map_err_into(SEK::CreateCallError)
|
.map_err_into(SEK::CreateCallError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,8 +344,9 @@ impl Store {
|
||||||
let mut fle = FileLockEntry::new(self, Entry::new(id));
|
let mut fle = FileLockEntry::new(self, Entry::new(id));
|
||||||
self.execute_hooks_for_mut_file(self.post_create_aspects.clone(), &mut fle)
|
self.execute_hooks_for_mut_file(self.post_create_aspects.clone(), &mut fle)
|
||||||
.map_err_into(SEK::PostHookExecuteError)
|
.map_err_into(SEK::PostHookExecuteError)
|
||||||
.map(|_| fle)
|
.map_err_into(SEK::HookExecutionError)
|
||||||
.map_err_into(SEK::CreateCallError)
|
.map_err_into(SEK::CreateCallError)
|
||||||
|
.map(|_| fle)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Borrow a given Entry. When the `FileLockEntry` is either `update`d or
|
/// Borrow a given Entry. When the `FileLockEntry` is either `update`d or
|
||||||
|
@ -357,6 +359,7 @@ impl Store {
|
||||||
if let Err(e) = self.execute_hooks_for_id(self.pre_retrieve_aspects.clone(), &id) {
|
if let Err(e) = self.execute_hooks_for_id(self.pre_retrieve_aspects.clone(), &id) {
|
||||||
return Err(e)
|
return Err(e)
|
||||||
.map_err_into(SEK::PreHookExecuteError)
|
.map_err_into(SEK::PreHookExecuteError)
|
||||||
|
.map_err_into(SEK::HookExecutionError)
|
||||||
.map_err_into(SEK::RetrieveCallError)
|
.map_err_into(SEK::RetrieveCallError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,6 +375,7 @@ impl Store {
|
||||||
.map(|e| FileLockEntry::new(self, e))
|
.map(|e| FileLockEntry::new(self, e))
|
||||||
.and_then(|mut fle| {
|
.and_then(|mut fle| {
|
||||||
self.execute_hooks_for_mut_file(self.post_retrieve_aspects.clone(), &mut fle)
|
self.execute_hooks_for_mut_file(self.post_retrieve_aspects.clone(), &mut fle)
|
||||||
|
.map_err_into(SEK::PostHookExecuteError)
|
||||||
.map_err_into(SEK::HookExecutionError)
|
.map_err_into(SEK::HookExecutionError)
|
||||||
.and(Ok(fle))
|
.and(Ok(fle))
|
||||||
})
|
})
|
||||||
|
@ -460,6 +464,7 @@ impl Store {
|
||||||
if let Err(e) = self.execute_hooks_for_mut_file(self.pre_update_aspects.clone(), &mut entry) {
|
if let Err(e) = self.execute_hooks_for_mut_file(self.pre_update_aspects.clone(), &mut entry) {
|
||||||
return Err(e)
|
return Err(e)
|
||||||
.map_err_into(SEK::PreHookExecuteError)
|
.map_err_into(SEK::PreHookExecuteError)
|
||||||
|
.map_err_into(SEK::HookExecutionError)
|
||||||
.map_err_into(SEK::UpdateCallError);
|
.map_err_into(SEK::UpdateCallError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -468,7 +473,8 @@ impl Store {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.execute_hooks_for_mut_file(self.post_update_aspects.clone(), &mut entry)
|
self.execute_hooks_for_mut_file(self.post_update_aspects.clone(), &mut entry)
|
||||||
.map_err_into(SEK::PreHookExecuteError)
|
.map_err_into(SEK::PostHookExecuteError)
|
||||||
|
.map_err_into(SEK::HookExecutionError)
|
||||||
.map_err_into(SEK::UpdateCallError)
|
.map_err_into(SEK::UpdateCallError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -523,6 +529,7 @@ impl Store {
|
||||||
if let Err(e) = self.execute_hooks_for_id(self.pre_delete_aspects.clone(), &id) {
|
if let Err(e) = self.execute_hooks_for_id(self.pre_delete_aspects.clone(), &id) {
|
||||||
return Err(e)
|
return Err(e)
|
||||||
.map_err_into(SEK::PreHookExecuteError)
|
.map_err_into(SEK::PreHookExecuteError)
|
||||||
|
.map_err_into(SEK::HookExecutionError)
|
||||||
.map_err_into(SEK::DeleteCallError)
|
.map_err_into(SEK::DeleteCallError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -546,7 +553,8 @@ impl Store {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.execute_hooks_for_id(self.post_delete_aspects.clone(), &id)
|
self.execute_hooks_for_id(self.post_delete_aspects.clone(), &id)
|
||||||
.map_err_into(SEK::PreHookExecuteError)
|
.map_err_into(SEK::PostHookExecuteError)
|
||||||
|
.map_err_into(SEK::HookExecutionError)
|
||||||
.map_err_into(SEK::DeleteCallError)
|
.map_err_into(SEK::DeleteCallError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,7 +598,8 @@ impl Store {
|
||||||
})
|
})
|
||||||
.map_err_into(SEK::FileError)
|
.map_err_into(SEK::FileError)
|
||||||
.and_then(|_| self.execute_hooks_for_id(self.post_move_aspects.clone(), &new_id)
|
.and_then(|_| self.execute_hooks_for_id(self.post_move_aspects.clone(), &new_id)
|
||||||
.map_err_into(SEK::PostHookExecuteError))
|
.map_err_into(SEK::PostHookExecuteError)
|
||||||
|
.map_err_into(SEK::HookExecutionError))
|
||||||
.map_err_into(SEK::MoveCallError)
|
.map_err_into(SEK::MoveCallError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -604,6 +613,7 @@ impl Store {
|
||||||
if let Err(e) = self.execute_hooks_for_id(self.pre_move_aspects.clone(), &old_id) {
|
if let Err(e) = self.execute_hooks_for_id(self.pre_move_aspects.clone(), &old_id) {
|
||||||
return Err(e)
|
return Err(e)
|
||||||
.map_err_into(SEK::PreHookExecuteError)
|
.map_err_into(SEK::PreHookExecuteError)
|
||||||
|
.map_err_into(SEK::HookExecutionError)
|
||||||
.map_err_into(SEK::MoveByIdCallError)
|
.map_err_into(SEK::MoveByIdCallError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -624,6 +634,7 @@ impl Store {
|
||||||
|
|
||||||
self.execute_hooks_for_id(self.pre_move_aspects.clone(), &new_id)
|
self.execute_hooks_for_id(self.pre_move_aspects.clone(), &new_id)
|
||||||
.map_err_into(SEK::PostHookExecuteError)
|
.map_err_into(SEK::PostHookExecuteError)
|
||||||
|
.map_err_into(SEK::HookExecutionError)
|
||||||
.map_err_into(SEK::MoveByIdCallError)
|
.map_err_into(SEK::MoveByIdCallError)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue