Add more context in error messages

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2019-05-18 00:14:34 +02:00
parent 5ebbcb774a
commit 27b75ba2fc

View file

@ -27,7 +27,6 @@ use crate::viewer::Viewer;
use failure::Fallible as Result; use failure::Fallible as Result;
use failure::ResultExt; use failure::ResultExt;
use failure::Error; use failure::Error;
use failure::err_msg;
pub struct EditorView<'a>(&'a Runtime<'a>); pub struct EditorView<'a>(&'a Runtime<'a>);
@ -43,7 +42,7 @@ impl<'a> Viewer for EditorView<'a> {
{ {
let mut entry = e.to_str()?.clone().to_string(); let mut entry = e.to_str()?.clone().to_string();
edit_in_tmpfile(self.0, &mut entry) edit_in_tmpfile(self.0, &mut entry)
.context(err_msg("Error while viewing")) .context("Error while viewing")
.map_err(Error::from) .map_err(Error::from)
} }
} }