1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Catch uncaught Alexa error (#24785)

This commit is contained in:
Paulus Schoutsen
2019-06-26 20:24:20 -07:00
committed by GitHub
parent 71346760d0
commit c87d6e4720
2 changed files with 41 additions and 3 deletions

View File

@@ -23,7 +23,7 @@ from homeassistant.components.google_assistant import helpers as google_helpers
from .const import (
DOMAIN, REQUEST_TIMEOUT, PREF_ENABLE_ALEXA, PREF_ENABLE_GOOGLE,
PREF_GOOGLE_SECURE_DEVICES_PIN, InvalidTrustedNetworks,
InvalidTrustedProxies, PREF_ALEXA_REPORT_STATE)
InvalidTrustedProxies, PREF_ALEXA_REPORT_STATE, RequireRelink)
_LOGGER = logging.getLogger(__name__)
@@ -388,7 +388,7 @@ async def websocket_update_prefs(hass, connection, msg):
connection.send_error(msg['id'], 'alexa_timeout',
'Timeout validating Alexa access token.')
return
except alexa_errors.NoTokenAvailable:
except (alexa_errors.NoTokenAvailable, RequireRelink):
connection.send_error(
msg['id'], 'alexa_relink',
'Please go to the Alexa app and re-link the Home Assistant '