Merge pull request #147 from neithernut/add-delete-error-handling

Add missing error handling
This commit is contained in:
Matthias Beyer 2016-01-25 22:12:40 +01:00
commit 7f63b82de1

View file

@ -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