diff --git a/lib/entry/libimagentryfilter/src/builtin/header/field_exists.rs b/lib/entry/libimagentryfilter/src/builtin/header/field_exists.rs index be816c8a..674a6f08 100644 --- a/lib/entry/libimagentryfilter/src/builtin/header/field_exists.rs +++ b/lib/entry/libimagentryfilter/src/builtin/header/field_exists.rs @@ -23,6 +23,7 @@ use toml_query::read::TomlValueReadExt; use filters::failable::filter::FailableFilter; use failure::Fallible as Result; +use failure::ResultExt; use failure::Error; use crate::builtin::header::field_path::FieldPath; @@ -47,6 +48,9 @@ impl FailableFilter for FieldExists { fn filter(&self, e: &Entry) -> Result { e.get_header() .read(&self.header_field_path[..]) + .context(format_err!("Failed reading header '{}' in '{}'", + self.header_field_path, + e.get_location())) .map_err(Error::from) .map(|o| o.is_some()) } diff --git a/lib/entry/libimagentryfilter/src/lib.rs b/lib/entry/libimagentryfilter/src/lib.rs index 550bbf7f..71faa18b 100644 --- a/lib/entry/libimagentryfilter/src/lib.rs +++ b/lib/entry/libimagentryfilter/src/lib.rs @@ -40,7 +40,7 @@ extern crate regex; extern crate semver; extern crate toml; extern crate toml_query; -extern crate failure; +#[macro_use] extern crate failure; extern crate libimagstore; extern crate libimagentrytag;