diff options
Diffstat (limited to 'lib/entry/libimagentryurl/src/linker.rs')
-rw-r--r-- | lib/entry/libimagentryurl/src/linker.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/entry/libimagentryurl/src/linker.rs b/lib/entry/libimagentryurl/src/linker.rs index 175ffcea..b38463e3 100644 --- a/lib/entry/libimagentryurl/src/linker.rs +++ b/lib/entry/libimagentryurl/src/linker.rs @@ -20,10 +20,10 @@ use libimagstore::storeid::StoreId; use libimagstore::store::Store; use libimagstore::store::Entry; -use libimagutil::debug_result::DebugResult; use libimagentrylink::linkable::Linkable; use failure::Fallible as Result; +use failure::ResultExt; use url::Url; use sha1::{Sha1, Digest}; use hex; @@ -93,7 +93,7 @@ impl UrlLinker for Entry { links.into_iter().map(|link| { let hash = hex::encode(Sha1::digest(&link.as_str().as_bytes())); let file_id = crate::module_path::new_id(hash.clone()) - .map_dbg_err(|_| format!("Failed to build StoreId for this hash '{:?}'", hash))?; + .with_context(|e| format!("Failed to build StoreId for this hash '{:?}': {}", hash, e))?; debug!("Link = '{:?}'", link); debug!("Hash = '{:?}'", hash); @@ -105,9 +105,7 @@ impl UrlLinker for Entry { // exist let mut file = store .retrieve(file_id.clone()) - .map_dbg_err(|_| { - format!("Failed to create or retrieve an file for this link '{:?}'", link) - })?; + .with_context(|e| format!("Failed to create or retrieve an file for this link '{:?}': {}", link, e))?; debug!("Generating header content!"); file.set_url(link)?; |