mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Always set severity level flag on render_template error events (#99804)
This commit is contained in:
parent
590ac173ed
commit
31fb9d12ea
@ -565,7 +565,9 @@ async def handle_render_template(
|
|||||||
if not report_errors:
|
if not report_errors:
|
||||||
return
|
return
|
||||||
connection.send_message(
|
connection.send_message(
|
||||||
messages.event_message(msg["id"], {"error": str(result)})
|
messages.event_message(
|
||||||
|
msg["id"], {"error": str(result), "level": "ERROR"}
|
||||||
|
)
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -1512,7 +1512,10 @@ async def test_render_template_with_delayed_error(
|
|||||||
assert msg["id"] == 5
|
assert msg["id"] == 5
|
||||||
assert msg["type"] == "event"
|
assert msg["type"] == "event"
|
||||||
event = msg["event"]
|
event = msg["event"]
|
||||||
assert event == {"error": "UndefinedError: 'explode' is undefined"}
|
assert event == {
|
||||||
|
"error": "UndefinedError: 'explode' is undefined",
|
||||||
|
"level": "ERROR",
|
||||||
|
}
|
||||||
|
|
||||||
assert "Template variable error" not in caplog.text
|
assert "Template variable error" not in caplog.text
|
||||||
assert "Template variable warning" not in caplog.text
|
assert "Template variable warning" not in caplog.text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user