From 112a2d6af8da55bb09b6dd755e0716b47acf45c4 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 18 May 2019 00:14:34 +0200 Subject: [PATCH] Add more context in error messages Signed-off-by: Matthias Beyer --- lib/core/libimagstore/src/configuration.rs | 1 + lib/core/libimagstore/src/storeid.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib/core/libimagstore/src/configuration.rs b/lib/core/libimagstore/src/configuration.rs index d0b3452d..3b9cc1e8 100644 --- a/lib/core/libimagstore/src/configuration.rs +++ b/lib/core/libimagstore/src/configuration.rs @@ -34,6 +34,7 @@ pub fn config_implicit_store_create_allowed(config: &Option) -> Result StoreIdWithBase<'a> { store_part.display()); let p = full_path .strip_prefix(store_part) + .context(format_err!("Cannot strip prefix '{}' from path: '{}'", + store_part.display(), + full_path.display())) .map_err(Error::from) .context(err_msg("Error building Store Id from full path"))?; Ok(StoreIdWithBase(store_part, PathBuf::from(p)))