mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Fetch MaxLengthExceeded exception mesage from the translation cache (#113904)
* Fetch MaxLengthExceeded exception mesage from the translation cache * Update homeassistant/components/homeassistant/strings.json Co-authored-by: J. Nick Koston <nick@koston.org> * Add case without homeassistant integration * Fix test --------- Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
@@ -281,14 +281,18 @@ class MaxLengthExceeded(HomeAssistantError):
|
||||
"""Initialize error."""
|
||||
super().__init__(
|
||||
self,
|
||||
(
|
||||
f"Value {value} for property {property_name} has a max length of "
|
||||
f"{max_length} characters"
|
||||
),
|
||||
translation_domain="homeassistant",
|
||||
translation_key="max_length_exceeded",
|
||||
translation_placeholders={
|
||||
"value": value,
|
||||
"property_name": property_name,
|
||||
"max_length": str(max_length),
|
||||
},
|
||||
)
|
||||
self.value = value
|
||||
self.property_name = property_name
|
||||
self.max_length = max_length
|
||||
self.generate_message = True
|
||||
|
||||
|
||||
class DependencyError(HomeAssistantError):
|
||||
|
||||
Reference in New Issue
Block a user