mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
Broaden exception handling for IQVIA (#32708)
This commit is contained in:
@@ -4,7 +4,7 @@ from datetime import timedelta
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from pyiqvia import Client
|
from pyiqvia import Client
|
||||||
from pyiqvia.errors import InvalidZipError, IQVIAError
|
from pyiqvia.errors import InvalidZipError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.config_entries import SOURCE_IMPORT
|
from homeassistant.config_entries import SOURCE_IMPORT
|
||||||
@@ -172,7 +172,7 @@ class IQVIAData:
|
|||||||
results = await asyncio.gather(*tasks.values(), return_exceptions=True)
|
results = await asyncio.gather(*tasks.values(), return_exceptions=True)
|
||||||
|
|
||||||
for key, result in zip(tasks, results):
|
for key, result in zip(tasks, results):
|
||||||
if isinstance(result, IQVIAError):
|
if isinstance(result, Exception):
|
||||||
_LOGGER.error("Unable to get %s data: %s", key, result)
|
_LOGGER.error("Unable to get %s data: %s", key, result)
|
||||||
self.data[key] = {}
|
self.data[key] = {}
|
||||||
continue
|
continue
|
||||||
|
Reference in New Issue
Block a user