Improve error message
This commit is contained in:
parent
bc86c53756
commit
ac352d75b0
|
@ -196,7 +196,7 @@
|
|||
"message": "A service which does not return responses can't be called with {return_response}."
|
||||
},
|
||||
"service_lacks_response_request": {
|
||||
"message": "The service call requires responses but caller did not ask for responses."
|
||||
"message": "The service call requires responses and must be called with {return_response}."
|
||||
},
|
||||
"service_reponse_invalid": {
|
||||
"message": "Failed to process the returned service response data, expected a dictionary, but got {response_data_type}."
|
||||
|
|
|
@ -2592,6 +2592,7 @@ class ServiceRegistry:
|
|||
raise ServiceValidationError(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="service_lacks_response_request",
|
||||
translation_placeholders={"return_response": "return_response=True"},
|
||||
)
|
||||
|
||||
if target:
|
||||
|
|
|
@ -1850,7 +1850,7 @@ async def test_serviceregistry_return_response_invalid(
|
|||
("supports_response", "return_response", "expected_error"),
|
||||
[
|
||||
(SupportsResponse.NONE, True, "does not return responses"),
|
||||
(SupportsResponse.ONLY, False, "caller did not ask for responses"),
|
||||
(SupportsResponse.ONLY, False, "call requires responses"),
|
||||
],
|
||||
)
|
||||
async def test_serviceregistry_return_response_arguments(
|
||||
|
|
Loading…
Reference in New Issue