Skip to content

Commit fb34af9

Browse files
committed
Catch retry errors
1 parent 3170131 commit fb34af9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pyisy/connection.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,14 @@ async def request(self, url, retries=0, ok404=False, delay=0):
170170

171171
except asyncio.TimeoutError:
172172
raise ISYConnectionError() from None
173-
except aiohttp.client_exceptions.ClientError as err:
173+
except (aiohttp.ClientOSError, aiohttp.ServerDisconnectedError):
174174
_LOGGER.debug(
175+
"ISY not ready or closed connection. Retrying in %ss, retry #%s",
176+
RETRY_BACKOFF[retries],
177+
retries + 1,
178+
)
179+
except aiohttp.client_exceptions.ClientError as err:
180+
_LOGGER.error(
175181
"ISY Could not receive response "
176182
"from device because of a network "
177183
"issue: %s",

0 commit comments

Comments
 (0)