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 322c063450
commit f44e10e295
1 changed files with 3 additions and 1 deletions

View File

@ -66,7 +66,9 @@ impl EditHeader for Entry {
fn edit_header_and_content(&mut self, rt: &Runtime) -> Result<()> { fn edit_header_and_content(&mut self, rt: &Runtime) -> Result<()> {
let mut header_and_content = self.to_str()?; let mut header_and_content = self.to_str()?;
let _ = edit_in_tmpfile(rt, &mut header_and_content)?; let _ = edit_in_tmpfile(rt, &mut header_and_content)?;
self.replace_from_buffer(&header_and_content).map_err(Error::from) self.replace_from_buffer(&header_and_content)
.context("Failed to replace header and content from buffer")
.map_err(Error::from)
} }
} }