mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Include _StopScript.__cause__ in trace (#50441)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
parent
5ed252ebfa
commit
b35f229674
@ -193,6 +193,9 @@ async def trace_action(hass, script_run, stop, variables):
|
||||
|
||||
try:
|
||||
yield trace_element
|
||||
except _StopScript as ex:
|
||||
trace_element.set_error(ex.__cause__ or ex)
|
||||
raise ex
|
||||
except Exception as ex:
|
||||
trace_element.set_error(ex)
|
||||
raise ex
|
||||
|
@ -622,7 +622,7 @@ async def test_delay_template_invalid(hass, caplog):
|
||||
assert_action_trace(
|
||||
{
|
||||
"0": [{"result": {"event": "test_event", "event_data": {}}}],
|
||||
"1": [{"error_type": script._StopScript}],
|
||||
"1": [{"error_type": vol.MultipleInvalid}],
|
||||
},
|
||||
expected_script_execution="aborted",
|
||||
)
|
||||
@ -683,7 +683,7 @@ async def test_delay_template_complex_invalid(hass, caplog):
|
||||
assert_action_trace(
|
||||
{
|
||||
"0": [{"result": {"event": "test_event", "event_data": {}}}],
|
||||
"1": [{"error_type": script._StopScript}],
|
||||
"1": [{"error_type": vol.MultipleInvalid}],
|
||||
},
|
||||
expected_script_execution="aborted",
|
||||
)
|
||||
@ -1138,7 +1138,7 @@ async def test_wait_continue_on_timeout(
|
||||
}
|
||||
if continue_on_timeout is False:
|
||||
expected_trace["0"][0]["result"]["timeout"] = True
|
||||
expected_trace["0"][0]["error_type"] = script._StopScript
|
||||
expected_trace["0"][0]["error_type"] = asyncio.TimeoutError
|
||||
expected_script_execution = "aborted"
|
||||
else:
|
||||
expected_trace["1"] = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user