Iterate through Tera error chain for better errors.

This commit is contained in:
Sergio Benitez 2017-02-17 00:23:41 -08:00
parent 937fe50ad7
commit 46403b8d0a
1 changed files with 5 additions and 1 deletions

View File

@ -56,7 +56,11 @@ pub fn render<T>(name: &str, _: &TemplateInfo, context: &T) -> Option<String>
match tera.value_render(name, context) { match tera.value_render(name, context) {
Ok(string) => Some(string), Ok(string) => Some(string),
Err(e) => { Err(e) => {
error_!("Error rendering Tera template '{}': {}", name, e); error_!("Error rendering Tera template '{}'.", name);
for error in e.iter().skip(1) {
error_!("{}.", error);
}
None None
} }
} }