From 79107674552dbb0b923bab08d9e20533010f8ed7 Mon Sep 17 00:00:00 2001 From: Tomas Peterka Date: Wed, 7 Jan 2026 18:17:49 +0100 Subject: [PATCH] fix(client): Print whole exceptions only in logging.DEBUG mode --- amqtt/client.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/amqtt/client.py b/amqtt/client.py index 981d4cf5..f1587a66 100644 --- a/amqtt/client.py +++ b/amqtt/client.py @@ -236,8 +236,7 @@ async def reconnect(self, cleansession: bool | None = None) -> int: self.logger.warning(f"Reconnection attempt failed: {e!r}") self.logger.debug("", exc_info=True) if 0 <= reconnect_retries < nb_attempt: - self.logger.exception("Maximum connection attempts reached. Reconnection aborted.") - self.logger.debug("", exc_info=True) + self.logger.debug("Maximum connection attempts reached. Reconnection aborted.", exc_info=e) msg = "Too many failed attempts" raise ConnectError(msg) from e delay = min(reconnect_max_interval, 2**nb_attempt)