From 2c741fe32e3ac76a24214306452e6b7f7ed9b14b Mon Sep 17 00:00:00 2001 From: Luke Bonaccorsi Date: Mon, 4 Mar 2024 01:07:44 +0000 Subject: [PATCH] fix: print stack trace on connection reset --- custom_components/robovac/tuyalocalapi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/robovac/tuyalocalapi.py b/custom_components/robovac/tuyalocalapi.py index b811951..772dc53 100644 --- a/custom_components/robovac/tuyalocalapi.py +++ b/custom_components/robovac/tuyalocalapi.py @@ -46,6 +46,7 @@ import struct import sys import time +import traceback from typing import Callable, Coroutine from cryptography.hazmat.backends.openssl import backend as openssl_backend @@ -835,7 +836,7 @@ async def _async_handle_message(self): self._LOGGER.debug("Incomplete read") elif isinstance(e, ConnectionResetError): self._LOGGER.debug( - "Connection reset: {}\n{}".format(e, e.__traceback__) + "Connection reset: {}\n{}".format(e, traceback.format_exc()) ) await self.async_disconnect()