Log zwave_js connection errors (#46867)

This commit is contained in:
Charles Garwood 2021-02-21 16:42:06 -05:00 committed by GitHub
parent c1ee9f7e4a
commit 50a07f6d25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,6 +181,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async with timeout(CONNECT_TIMEOUT): async with timeout(CONNECT_TIMEOUT):
await client.connect() await client.connect()
except (asyncio.TimeoutError, BaseZwaveJSServerError) as err: except (asyncio.TimeoutError, BaseZwaveJSServerError) as err:
LOGGER.error("Failed to connect: %s", err)
raise ConfigEntryNotReady from err raise ConfigEntryNotReady from err
else: else:
LOGGER.info("Connected to Zwave JS Server") LOGGER.info("Connected to Zwave JS Server")
@ -268,8 +269,8 @@ async def client_listen(
await client.listen(driver_ready) await client.listen(driver_ready)
except asyncio.CancelledError: except asyncio.CancelledError:
should_reload = False should_reload = False
except BaseZwaveJSServerError: except BaseZwaveJSServerError as err:
pass LOGGER.error("Failed to listen: %s", err)
# The entry needs to be reloaded since a new driver state # The entry needs to be reloaded since a new driver state
# will be acquired on reconnect. # will be acquired on reconnect.