From bbf6850a1de0a38d5b26ae3404bf30fa30f1ebd8 Mon Sep 17 00:00:00 2001 From: Justin Myers Date: Tue, 21 May 2024 17:43:42 -0700 Subject: [PATCH] pystack and other errors --- adafruit_minimqtt/adafruit_minimqtt.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adafruit_minimqtt/adafruit_minimqtt.py b/adafruit_minimqtt/adafruit_minimqtt.py index e28a767..73182d1 100644 --- a/adafruit_minimqtt/adafruit_minimqtt.py +++ b/adafruit_minimqtt/adafruit_minimqtt.py @@ -435,7 +435,10 @@ def connect( self._reset_reconnect_backoff() return ret except (MemoryError, OSError, RuntimeError) as e: + if isinstance(e, RuntimeError) and e.args == ("pystack exhausted",): + raise self.logger.warning(f"Socket error when connecting: {e}") + last_exception = e backoff = False except MMQTTException as e: self._close_socket()