From d775985d05ef0c1f005d91389a33f8ec6935206b Mon Sep 17 00:00:00 2001 From: Zac Mrowicki Date: Thu, 17 Oct 2019 16:19:55 +0000 Subject: [PATCH] thar-be-settings: log a render error when running in --all mode When running in `--all` mode, thar-be-settings does not fail when a template fails to render. This commit logs a message with the appropriate details in the event of a failure. --- workspaces/api/thar-be-settings/src/config.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/workspaces/api/thar-be-settings/src/config.rs b/workspaces/api/thar-be-settings/src/config.rs index 7214670654e..baf7455ac33 100644 --- a/workspaces/api/thar-be-settings/src/config.rs +++ b/workspaces/api/thar-be-settings/src/config.rs @@ -73,8 +73,11 @@ pub fn render_config_files( let rendered = try_rendered.context(error::TemplateRender { template: name })?; rendered_configs.push(RenderedConfigFile::new(&metadata.path, rendered)); } else { - if let Ok(rendered) = try_rendered { - rendered_configs.push(RenderedConfigFile::new(&metadata.path, rendered)); + match try_rendered { + Ok(rendered) => { + rendered_configs.push(RenderedConfigFile::new(&metadata.path, rendered)) + } + Err(err) => warn!("Unable to render template '{}': {}", &name, err), } } }