Improve err handling
This commit is contained in:
1 parent
fb12294bb7
commit
df3c683023
3 files changed
+15
-6
No files matched your search
@@ -16,7 +16,7 @@ from homeassistant.const import (EVENT_HOMEASSISTANT_STOP, CONF_ACCESS_TOKEN,
|
||||
from homeassistant.helpers import discovery
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
|
||||
REQUIREMENTS = ['pyTibber==0.8.3']
|
||||
REQUIREMENTS = ['pyTibber==0.8.4']
|
||||
|
||||
DOMAIN = 'tibber'
|
||||
|
||||
@@ -45,7 +45,11 @@ async def async_setup(hass, config):
|
||||
|
||||
try:
|
||||
await tibber_connection.update_info()
|
||||
except (asyncio.TimeoutError, aiohttp.ClientError):
|
||||
except asyncio.TimeoutError as err:
|
||||
_LOGGER.error("Timeout connecting to Tibber: %s ", err)
|
||||
return False
|
||||
except aiohttp.ClientError as err:
|
||||
_LOGGER.error("Error connecting to Tibber: %s ", err)
|
||||
return False
|
||||
except tibber.InvalidLogin as exp:
|
||||
_LOGGER.error("Failed to login. %s", exp)
|
||||
|
||||
Reference in new issue
Block a user