From d333593aa65b51641ab0a4c8a5831e139e70ca18 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 2 Mar 2018 11:21:30 -0800 Subject: [PATCH] Handle Hue errors better (#12845) * Handle Hue errors better * Lint --- homeassistant/components/hue.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/hue.py b/homeassistant/components/hue.py index 36d5a1a56a0..2d64306ca74 100644 --- a/homeassistant/components/hue.py +++ b/homeassistant/components/hue.py @@ -192,7 +192,7 @@ class HueBridge(object): self.bridge = phue.Bridge( self.host, config_file_path=self.hass.config.path(self.filename)) - except ConnectionRefusedError: # Wrong host was given + except (ConnectionRefusedError, OSError): # Wrong host was given _LOGGER.error("Error connecting to the Hue bridge at %s", self.host) return @@ -201,6 +201,9 @@ class HueBridge(object): self.host) self.request_configuration() return + except Exception: # pylint: disable=broad-except + _LOGGER.exception("Unknown error connecting with Hue bridge at %s", + self.host) # If we came here and configuring this host, mark as done if self.config_request_id: