From 740729bfdaf4f5e9a935c420dc7b64321365b0c6 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/domain/libimagwiki/src/wiki.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/domain/libimagwiki/src/wiki.rs b/lib/domain/libimagwiki/src/wiki.rs index 6e88a760..4024e29a 100644 --- a/lib/domain/libimagwiki/src/wiki.rs +++ b/lib/domain/libimagwiki/src/wiki.rs @@ -27,6 +27,7 @@ use libimagentrylink::internal::InternalLinker; use failure::Fallible as Result; use failure::Error; use failure::err_msg; +use failure::ResultExt; pub struct Wiki<'a, 'b>(&'a Store, &'b str); @@ -58,6 +59,7 @@ impl<'a, 'b> Wiki<'a, 'b> { self.0 .get(sid) + .context("Cannot get ID from store") .map_err(Error::from)? .ok_or_else(|| Error::from(err_msg("Missing index"))) }