Add more context in error messages
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
00fa3e7b78
commit
112a2d6af8
2 changed files with 4 additions and 0 deletions
|
@ -34,6 +34,7 @@ pub fn config_implicit_store_create_allowed(config: &Option<Value>) -> Result<bo
|
|||
|
||||
if let Some(ref t) = *config {
|
||||
t.read_bool(key)
|
||||
.context(format_err!("Error reading header '{}' in configuration", key))
|
||||
.map_err(Error::from)
|
||||
.context(EM::TomlQueryError)?
|
||||
.ok_or_else(|| format_err!("Config key missing: {}", key))
|
||||
|
|
|
@ -184,6 +184,9 @@ impl<'a> 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)))
|
||||
|
|
Loading…
Reference in a new issue