Merge pull request #147 from neithernut/add-delete-error-handling
Add missing error handling
This commit is contained in:
commit
7f63b82de1
1 changed files with 4 additions and 0 deletions
|
@ -193,6 +193,10 @@ impl Store {
|
|||
/// Delete an entry
|
||||
pub fn delete(&self, id: StoreId) -> Result<()> {
|
||||
let mut entries_lock = self.entries.write();
|
||||
if entries_lock.is_err() {
|
||||
return Err(StoreError::new(StoreErrorKind::LockPoisoned, None))
|
||||
}
|
||||
|
||||
let mut entries = entries_lock.unwrap();
|
||||
|
||||
// if the entry is currently modified by the user, we cannot drop it
|
||||
|
|
Loading…
Reference in a new issue