diff --git a/adafruit_portalbase/network.py b/adafruit_portalbase/network.py index 1a71c07..d35c50f 100644 --- a/adafruit_portalbase/network.py +++ b/adafruit_portalbase/network.py @@ -343,7 +343,7 @@ def connect(self, max_attempts=10): try: self._wifi.connect(self._secrets["ssid"], self._secrets["password"]) self.requests = self._wifi.requests - except RuntimeError as error: + except ConnectionError as error: if max_attempts is not None and attempt >= max_attempts: raise OSError( "Maximum number of attempts reached when trying to connect to WiFi"