mirror of https://github.com/rwf2/Rocket.git
Iterate through Tera error chain for better errors.
This commit is contained in:
parent
937fe50ad7
commit
46403b8d0a
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue