From ff8569809bd4013b9ec5b47c8f527365d70325bf Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 9 Sep 2017 21:31:13 +0200 Subject: [PATCH] Add parameter to StorePathExists error --- lib/core/libimagstore/src/error.rs | 6 ++++-- lib/core/libimagstore/src/store.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/core/libimagstore/src/error.rs b/lib/core/libimagstore/src/error.rs index f2d338fc..8d0b180c 100644 --- a/lib/core/libimagstore/src/error.rs +++ b/lib/core/libimagstore/src/error.rs @@ -17,6 +17,8 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // +use std::path::PathBuf; + use storeid::StoreId; error_chain! { @@ -116,9 +118,9 @@ error_chain! { display("Directory/Directories could not be created") } - StorePathExists { + StorePathExists(pb: PathBuf) { description("Store path exists") - display("Store path exists") + display("Store path exists: {:?}", pb) } StorePathCreate { diff --git a/lib/core/libimagstore/src/store.rs b/lib/core/libimagstore/src/store.rs index 64219c46..0945c3a4 100644 --- a/lib/core/libimagstore/src/store.rs +++ b/lib/core/libimagstore/src/store.rs @@ -274,7 +274,7 @@ impl Store { .map_dbg_err_str("Failed")); } else if location.is_file() { debug!("Store path exists as file"); - return Err(SE::from_kind(SEK::StorePathExists)); + return Err(SE::from_kind(SEK::StorePathExists(location))); } let store = Store {