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 6e0a179550
commit 322c063450
2 changed files with 4 additions and 1 deletions

View File

@ -92,6 +92,9 @@ impl EntryDate for Entry {
self.get_header_mut()
.insert(&DATE_HEADER_LOCATION, Value::String(date))
.context(format_err!("Failed to insert header '{}' in '{}'",
*DATE_HEADER_LOCATION,
self.get_location()))
.map_err(Error::from)
.map(|opt| opt.map(|stri| {
stri.as_str()

View File

@ -38,10 +38,10 @@
)]
#[macro_use] extern crate lazy_static;
#[macro_use] extern crate failure;
extern crate chrono;
extern crate toml_query;
extern crate toml;
extern crate failure;
extern crate libimagerror;
extern crate libimagstore;