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)