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 c7f5420c1d
commit 00fa3e7b78
2 changed files with 3 additions and 0 deletions

View file

@ -370,6 +370,7 @@ fn aggregate_module_settings(_matches: &ArgMatches, config: Option<&Value>)
for (module_name, v) in t {
let destinations = inner_try! {
v.read("destinations")
.context("Failed reading header 'destinations'")
.map_err(Error::from)
.context(EM::TomlQueryError)?
.map(|val| {
@ -384,6 +385,7 @@ fn aggregate_module_settings(_matches: &ArgMatches, config: Option<&Value>)
let level = inner_try! {
v.read_string("level")
.context("Failed reading header 'level'")
.map_err(Error::from)
.context(EM::TomlQueryError)?
.map(|s| match_log_level_str(&s))

View file

@ -408,6 +408,7 @@ impl<'a> Runtime<'a> {
let mut buf = String::new();
lock.read_to_string(&mut buf)
.context("Failed to read stdin to buffer")
.map_err(Error::from)
.and_then(|_| {
trace!("Got IDs = {}", buf);