Send localization info on websocket_api script errors (#104638)

* Send localization info on script errors

* Use connection exception hander

* Keep HomeAssistantError is unknown_error

* Move specific exception handling
This commit is contained in:
Jan Bouwhuis 2023-11-29 10:47:23 +01:00 committed by GitHub
parent 7dbaf40f48
commit efd330f182
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 106 additions and 3 deletions

View file

@ -43,6 +43,12 @@ from tests.common import MockUser
"Failed to do X",
"Error handling message: Failed to do X (unknown_error) Mock User from 127.0.0.42 (Browser)",
),
(
exceptions.ServiceValidationError("Failed to do X"),
websocket_api.ERR_UNKNOWN_ERROR,
"Failed to do X",
"Error handling message: Failed to do X (unknown_error) Mock User from 127.0.0.42 (Browser)",
),
(
ValueError("Really bad"),
websocket_api.ERR_UNKNOWN_ERROR,