Always set severity level flag on render_template error events (#99804)
This commit is contained in:
parent
9351e79dcb
commit
e5210c5823
2 changed files with 7 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue