mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-01-09 06:17:08 +00:00
handle cancellation
This commit is contained in:
parent
8e51fa7d31
commit
bd285a9fb0
@ -168,6 +168,12 @@ class TPLinkSmartHomeProtocol:
|
|||||||
_LOGGER.debug(
|
_LOGGER.debug(
|
||||||
"Unable to query the device %s, retrying: %s", self.host, ex
|
"Unable to query the device %s, retrying: %s", self.host, ex
|
||||||
)
|
)
|
||||||
|
except BaseException as ex:
|
||||||
|
# Likely something cancelled the task, so we need to close the connection
|
||||||
|
await self.close()
|
||||||
|
_LOGGER.debug(
|
||||||
|
"BaseException during query, closing connection: %s", self.host, ex
|
||||||
|
)
|
||||||
|
|
||||||
# make mypy happy, this should never be reached..
|
# make mypy happy, this should never be reached..
|
||||||
await self.close()
|
await self.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user