Skip to content

Commit 2c741fe

Browse files
fix: print stack trace on connection reset
1 parent 3dd4a7b commit 2c741fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

custom_components/robovac/tuyalocalapi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import struct
4747
import sys
4848
import time
49+
import traceback
4950
from typing import Callable, Coroutine
5051

5152
from cryptography.hazmat.backends.openssl import backend as openssl_backend
@@ -835,7 +836,7 @@ async def _async_handle_message(self):
835836
self._LOGGER.debug("Incomplete read")
836837
elif isinstance(e, ConnectionResetError):
837838
self._LOGGER.debug(
838-
"Connection reset: {}\n{}".format(e, e.__traceback__)
839+
"Connection reset: {}\n{}".format(e, traceback.format_exc())
839840
)
840841
await self.async_disconnect()
841842

0 commit comments

Comments
 (0)