diff --git a/lib/core/libimagrt/src/error.rs b/lib/core/libimagrt/src/error.rs index 3ecca79e..495d5863 100644 --- a/lib/core/libimagrt/src/error.rs +++ b/lib/core/libimagrt/src/error.rs @@ -22,6 +22,10 @@ error_chain! { RuntimeError, RuntimeErrorKind, ResultExt, Result; } + foreign_links { + HandlebarsTemplateError(::handlebars::TemplateError); + } + errors { Instantiate { description("Could not instantiate") @@ -73,11 +77,6 @@ error_chain! { display("Error while reading in TOML document") } - TemplateStringRegistrationError { - description("Error while registering logging template string") - display("Error while registering logging template string") - } - 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 8785e27b..e4dc6670 100644 --- a/lib/core/libimagrt/src/logger.rs +++ b/lib/core/libimagrt/src/logger.rs @@ -93,28 +93,23 @@ impl ImagLogger { { let fmt = try!(aggregate_global_format_trace(matches, config)); - try!(handlebars.register_template_string("TRACE", fmt) // name must be uppercase - .chain_err(|| EK::TemplateStringRegistrationError)); + try!(handlebars.register_template_string("TRACE", fmt)); // name must be uppercase } { let fmt = try!(aggregate_global_format_debug(matches, config)); - try!(handlebars.register_template_string("DEBUG", fmt) // name must be uppercase - .chain_err(|| EK::TemplateStringRegistrationError)); + try!(handlebars.register_template_string("DEBUG", fmt)); // name must be uppercase } { let fmt = try!(aggregate_global_format_info(matches, config)); - try!(handlebars.register_template_string("INFO", fmt) // name must be uppercase - .chain_err(|| EK::TemplateStringRegistrationError)); + try!(handlebars.register_template_string("INFO", fmt)); // name must be uppercase } { let fmt = try!(aggregate_global_format_warn(matches, config)); - try!(handlebars.register_template_string("WARN", fmt) // name must be uppercase - .chain_err(|| EK::TemplateStringRegistrationError)); + try!(handlebars.register_template_string("WARN", fmt)); // name must be uppercase } { let fmt = try!(aggregate_global_format_error(matches, config)); - try!(handlebars.register_template_string("ERROR", fmt) // name must be uppercase - .chain_err(|| EK::TemplateStringRegistrationError)); + try!(handlebars.register_template_string("ERROR", fmt)); // name must be uppercase } Ok(ImagLogger {