diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2019-12-22 17:47:32 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2019-12-23 11:17:44 +0100 |
commit | 8ffb06cef3ac7a066a74121abd406f731073b8a0 (patch) | |
tree | 538c0efeaa306a5f9f72c6fa88bda7a44221f058 /lib/entry/libimagentryurl/src/iter.rs | |
parent | 1c5a81d5b024ef90a45345dc3dc13481afb7929a (diff) |
Replace map_dbg_err() calls with context() calls
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'lib/entry/libimagentryurl/src/iter.rs')
-rw-r--r-- | lib/entry/libimagentryurl/src/iter.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/entry/libimagentryurl/src/iter.rs b/lib/entry/libimagentryurl/src/iter.rs index 4a22a6b1..eb60e6bd 100644 --- a/lib/entry/libimagentryurl/src/iter.rs +++ b/lib/entry/libimagentryurl/src/iter.rs @@ -35,6 +35,8 @@ use libimagstore::store::Store; use libimagutil::debug_result::DebugResult; use failure::Fallible as Result; +use failure::ResultExt; +use failure::Error; use url::Url; /// Helper for building `OnlyUrlIter` and `NoUrlIter` @@ -170,14 +172,15 @@ impl<'a> Iterator for UrlIter<'a> { debug!("Retrieving entry for id: '{:?}'", id); self.1 .retrieve(id.clone()) - .map_dbg_err(|_| format!("Retrieving entry for id: '{:?}' failed", id)) + .with_context(|e| format!("Retrieving entry for id: '{:?}' failed: {}", id, e)) .map_err(From::from) .and_then(|f| { debug!("Store::retrieve({:?}) succeeded", id); debug!("getting uri link from file now"); f.get_url() .map_dbg_str("Error happened while getting link URI from FLE") - .map_dbg_err(|e| format!("URL -> Err = {:?}", e)) + .with_context(|e| format!("URL -> Err = {:?}", e)) + .map_err(Error::from) }) }); |