Skip to content

Commit

Permalink
Fix: not all the places catch exceptions from exchange()
Browse files Browse the repository at this point in the history
  • Loading branch information
Lurker00 committed Jul 29, 2024
1 parent 21af3e1 commit 7b0950f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/localtuya/core/pytuya/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,10 @@ async def exchange(self, command, dps=None, nodeID=None, payload=None):

enc_payload = self._encode_message(payload)

await self.transport_write(enc_payload)
try:
await self.transport_write(enc_payload)
except Exception: # pylint: disable=broad-except
return self.clean_up_session()
msg = await self.dispatcher.wait_for(seqno, payload.cmd)
if msg is None:
self.debug("Wait was aborted for seqno %d", seqno)
Expand Down

0 comments on commit 7b0950f

Please sign in to comment.