Capture compilation errors on additional templates

Shouldn't cause the whole page not to render but log an error. Should
provide more resilience against bad plugins.
This commit is contained in:
Gina Häußge 2015-07-24 12:14:00 +02:00
parent 6f5c6f5404
commit d25202d94e

View file

@ -320,6 +320,8 @@ def _process_template_configs(name, implementation, configs, rules):
app.jinja_env.get_or_select_template(data["template"]) app.jinja_env.get_or_select_template(data["template"])
except TemplateNotFound: except TemplateNotFound:
pass pass
except:
_logger.exception("Error in template {}, not going to include it".format(data["template"]))
else: else:
includes[template_type].append(rule["to_entry"](data)) includes[template_type].append(rule["to_entry"](data))