Generate ConfigValidationError message from English translations (#113844)

* Fetch ConfigValidationError message from translation cache

* Sync error logmessages with translation cache

* More sync

* Cleanup

* Remove unrelated change

* Follow up comments

* Rebase and improve contructor

* Improve name

* Rename to MULTIPLE_INTEGRATION_CONFIG_ERRORS
This commit is contained in:
Jan Bouwhuis 2024-03-25 10:39:30 +01:00 committed by GitHub
parent a58049554d
commit 19fa39d556
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 200 additions and 178 deletions

View file

@ -87,20 +87,19 @@ class ConfigValidationError(HomeAssistantError, ExceptionGroup[Exception]):
def __init__(
self,
message: str,
message_translation_key: str,
exceptions: list[Exception],
translation_domain: str | None = None,
translation_key: str | None = None,
translation_placeholders: dict[str, str] | None = None,
) -> None:
"""Initialize exception."""
super().__init__(
*(message, exceptions),
*(message_translation_key, exceptions),
translation_domain=translation_domain,
translation_key=translation_key,
translation_key=message_translation_key,
translation_placeholders=translation_placeholders,
)
self._message = message
self.generate_message = True
class ServiceValidationError(HomeAssistantError):