mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Always set severity level flag on render_template error events (#99804)
This commit is contained in:
parent
9351e79dcb
commit
e5210c5823
@ -565,7 +565,9 @@ async def handle_render_template(
|
||||
if not report_errors:
|
||||
return
|
||||
connection.send_message(
|
||||
messages.event_message(msg["id"], {"error": str(result)})
|
||||
messages.event_message(
|
||||
msg["id"], {"error": str(result), "level": "ERROR"}
|
||||
)
|
||||
)
|
||||
return
|
||||
|
||||
|
@ -1512,7 +1512,10 @@ async def test_render_template_with_delayed_error(
|
||||
assert msg["id"] == 5
|
||||
assert msg["type"] == "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 warning" not in caplog.text
|
||||
|
Loading…
x
Reference in New Issue
Block a user