diff --git a/lib/core/libimagrt/src/error.rs b/lib/core/libimagrt/src/error.rs index 495d5863..86fe7652 100644 --- a/lib/core/libimagrt/src/error.rs +++ b/lib/core/libimagrt/src/error.rs @@ -23,6 +23,7 @@ error_chain! { } foreign_links { + TomlError(::toml_query::error::Error); HandlebarsTemplateError(::handlebars::TemplateError); } @@ -72,11 +73,6 @@ error_chain! { display("Invalid log level specification: Only 'trace', 'debug', 'info', 'warn', 'error' are allowed") } - TomlReadError { - description("Error while reading in TOML document") - display("Error while reading in TOML document") - } - ConfigMissingLoggingFormatTrace { description("Missing config for logging format for trace logging") display("Missing config for logging format for trace logging") diff --git a/lib/core/libimagrt/src/logger.rs b/lib/core/libimagrt/src/logger.rs index e4dc6670..7a7b8186 100644 --- a/lib/core/libimagrt/src/logger.rs +++ b/lib/core/libimagrt/src/logger.rs @@ -374,21 +374,21 @@ fn aggregate_module_settings(_matches: &ArgMatches, config: Option<&Configuratio Ok(Some(&Value::Array(ref a))) => translate_destinations(a).map(Some), Ok(None) => Ok(None), Ok(Some(_)) => Err(RE::from_kind(EK::ConfigTypeError)), - Err(e) => Err(e).chain_err(|| EK::TomlReadError), + Err(e) => Err(e).map_err(From::from), }); let level = try!(match v.read("level") { Ok(Some(&Value::String(ref s))) => match_log_level_str(s).map(Some), Ok(None) => Ok(None), Ok(Some(_)) => Err(RE::from_kind(EK::ConfigTypeError)), - Err(e) => Err(e).chain_err(|| EK::TomlReadError), + Err(e) => Err(e).map_err(From::from), }); let enabled = try!(match v.read("enabled") { Ok(Some(&Value::Boolean(b))) => Ok(b), Ok(None) => Ok(false), Ok(Some(_)) => Err(RE::from_kind(EK::ConfigTypeError)), - Err(e) => Err(e).chain_err(|| EK::TomlReadError), + Err(e) => Err(e).map_err(From::from), }); let module_settings = ModuleSettings {