From 31dd327c59b659a505fa23fdf984e4c20d464294 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 2 Oct 2018 14:35:43 +0200 Subject: [PATCH] Catch possible errors from tradfri (#17068) * Catch possible errors from tradfri * Update config_flow.py --- homeassistant/components/tradfri/config_flow.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/tradfri/config_flow.py b/homeassistant/components/tradfri/config_flow.py index 29aa768dbb5..f3c52f42a9a 100644 --- a/homeassistant/components/tradfri/config_flow.py +++ b/homeassistant/components/tradfri/config_flow.py @@ -169,7 +169,9 @@ async def get_gateway_info(hass, host, identity, key): api = factory.request gateway = Gateway() gateway_info_result = await api(gateway.get_gateway_info()) - except RequestError: + except (OSError, RequestError): + # We're also catching OSError as PyTradfri doesn't catch that one yet + # Upstream PR: https://github.com/ggravlingen/pytradfri/pull/189 raise AuthError('cannot_connect') return {