diff options
author | schwente <sascha.schwenteck@hs-furtwangen.de> | 2016-06-06 14:16:53 +0200 |
---|---|---|
committer | schwente <sascha.schwenteck@hs-furtwangen.de> | 2016-06-06 14:16:53 +0200 |
commit | 11b0622804a4766d5d173f93862aad751781f579 (patch) | |
tree | cd3b86574545bf224382949143cc5fe57df7d55b /libimagtodo | |
parent | d5dd55820a7561074029e48d9c9c3e69e1664a88 (diff) |
Fixed the store.delete(...) Return Problem
Diffstat (limited to 'libimagtodo')
-rw-r--r-- | libimagtodo/src/delete.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libimagtodo/src/delete.rs b/libimagtodo/src/delete.rs index 79dd8ca5..13d418bf 100644 --- a/libimagtodo/src/delete.rs +++ b/libimagtodo/src/delete.rs @@ -4,16 +4,16 @@ // use std::fs::File; // use std::io::Read; -use std::ops::Deref; -use toml::Value; use uuid::Uuid; use libimagstore::store::Store; use libimagstore::storeid::IntoStoreId; use module_path::ModuleEntryPath; +use error::{TodoError, TodoErrorKind}; + /// With the uuid we get the storeid and than we can delete the entry -fn deleteFunc(uuid: Uuid, store : &Store) { +pub fn deleteFunc(uuid: Uuid, store : &Store) { // With this we can read from a .json File // let mut file = File::open("text.json").unwrap(); // let mut data = String::new(); @@ -25,6 +25,9 @@ fn deleteFunc(uuid: Uuid, store : &Store) { // With the uuid we get the storeid let store_id = ModuleEntryPath::new(format!("taskwarrior/{}", uuid)).into_storeid(); // It deletes an entry - store.delete(store_id); + if let Err(e) = store.delete(store_id) { + return Err(TodoError::new(TodoErrorKind::StoreError, Some(Box::new(e)))).unwrap(); + } + } |