backup/datastore.rs: improve error reporting

This commit is contained in:
Dietmar Maurer 2019-02-15 14:33:03 +01:00
parent 9b50c16103
commit f0a6112451
1 changed files with 5 additions and 6 deletions

View File

@ -58,13 +58,12 @@ impl DataStore {
}
}
if let Ok(datastore) = DataStore::open(name) {
let datastore = Arc::new(datastore);
map.insert(name.to_string(), datastore.clone());
return Ok(datastore);
}
let datastore = DataStore::open(name)?;
bail!("store not found");
let datastore = Arc::new(datastore);
map.insert(name.to_string(), datastore.clone());
Ok(datastore)
}
pub fn open(store_name: &str) -> Result<Self, Error> {