Skip to content

Commit

Permalink
Optionally do not log template rendering errors
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery committed Nov 26, 2018
1 parent 5e18d52 commit b5b0ce1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions homeassistant/helpers/template.py
Expand Up @@ -169,8 +169,10 @@ def async_render_with_possible_json_value(self, value,
try:
return self._compiled.render(variables).strip()
except jinja2.TemplateError as ex:
_LOGGER.error("Error parsing value: %s (value: %s, template: %s)",
ex, value, self.template)
if error_value is _SENTINEL:
_LOGGER.error(
"Error parsing value: %s (value: %s, template: %s)",
ex, value, self.template)
return value if error_value is _SENTINEL else error_value

def _ensure_compiled(self):
Expand Down

0 comments on commit b5b0ce1

Please sign in to comment.