mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 13:47:35 +00:00
Fix error messaging for cascading service calls (#136966)
This commit is contained in:
parent
ab5583ed40
commit
3fb70316da
@ -275,10 +275,10 @@ async def handle_call_service(
|
|||||||
translation_domain=const.DOMAIN,
|
translation_domain=const.DOMAIN,
|
||||||
translation_key="child_service_not_found",
|
translation_key="child_service_not_found",
|
||||||
translation_placeholders={
|
translation_placeholders={
|
||||||
"domain": err.domain,
|
"domain": msg["domain"],
|
||||||
"service": err.service,
|
"service": msg["service"],
|
||||||
"child_domain": msg["domain"],
|
"child_domain": err.domain,
|
||||||
"child_service": msg["service"],
|
"child_service": err.service,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
except vol.Invalid as err:
|
except vol.Invalid as err:
|
||||||
|
@ -460,10 +460,10 @@ async def test_call_service_child_not_found(
|
|||||||
"domain_test.test_service which was not found."
|
"domain_test.test_service which was not found."
|
||||||
)
|
)
|
||||||
assert msg["error"]["translation_placeholders"] == {
|
assert msg["error"]["translation_placeholders"] == {
|
||||||
"domain": "non",
|
"domain": "domain_test",
|
||||||
"service": "existing",
|
"service": "test_service",
|
||||||
"child_domain": "domain_test",
|
"child_domain": "non",
|
||||||
"child_service": "test_service",
|
"child_service": "existing",
|
||||||
}
|
}
|
||||||
assert msg["error"]["translation_key"] == "child_service_not_found"
|
assert msg["error"]["translation_key"] == "child_service_not_found"
|
||||||
assert msg["error"]["translation_domain"] == "websocket_api"
|
assert msg["error"]["translation_domain"] == "websocket_api"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user