Catch ValueError in google_translate (#42405)
This commit is contained in:
parent
f716b7714b
commit
3ec83dc29e
3 changed files with 9 additions and 5 deletions
|
@ -161,7 +161,6 @@ homeassistant/components/goalzero/* @tkdrob
|
|||
homeassistant/components/gogogate2/* @vangorra
|
||||
homeassistant/components/google_assistant/* @home-assistant/cloud
|
||||
homeassistant/components/google_cloud/* @lufton
|
||||
homeassistant/components/google_translate/* @awarecan
|
||||
homeassistant/components/gpsd/* @fabaff
|
||||
homeassistant/components/gree/* @cmroche
|
||||
homeassistant/components/greeneye_monitor/* @jkeljo
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
"name": "Google Translate Text-to-Speech",
|
||||
"documentation": "https://www.home-assistant.io/integrations/google_translate",
|
||||
"requirements": ["gTTS-token==1.1.3"],
|
||||
"codeowners": ["@awarecan"]
|
||||
"codeowners": []
|
||||
}
|
||||
|
|
|
@ -123,9 +123,14 @@ class GoogleProvider(Provider):
|
|||
|
||||
data = b""
|
||||
for idx, part in enumerate(message_parts):
|
||||
part_token = await self.hass.async_add_executor_job(
|
||||
token.calculate_token, part
|
||||
)
|
||||
try:
|
||||
part_token = await self.hass.async_add_executor_job(
|
||||
token.calculate_token, part
|
||||
)
|
||||
except ValueError as err:
|
||||
# If token seed fetching fails.
|
||||
_LOGGER.warning(err)
|
||||
return None, None
|
||||
|
||||
url_param = {
|
||||
"ie": "UTF-8",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue