Skip to content

Commit 9b0f67f

Browse files
Recreate resolver also on DNSError in dnsip (home-assistant#155120)
1 parent 2739064 commit 9b0f67f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

homeassistant/components/dnsip/sensor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,12 @@ async def async_update(self) -> None:
122122
try:
123123
async with asyncio.timeout(10):
124124
response = await self.resolver.query(self.hostname, self.querytype)
125-
except TimeoutError:
125+
except TimeoutError as err:
126+
_LOGGER.debug("Timeout while resolving host: %s", err)
126127
await self.resolver.close()
127128
except DNSError as err:
128129
_LOGGER.warning("Exception while resolving host: %s", err)
130+
await self.resolver.close()
129131

130132
if response:
131133
sorted_ips = sort_ips(

0 commit comments

Comments
 (0)