Handle mqtt.WebsocketConnectionError when connecting to the MQTT broker (#133610)

fixes #132985
This commit is contained in:
J. Nick Koston
2024-12-19 10:39:39 -10:00
committed by GitHub
parent b261c7f18a
commit 551a584ca6
2 changed files with 10 additions and 3 deletions

View File

@ -661,7 +661,7 @@ class MQTT:
self.conf.get(CONF_PORT, DEFAULT_PORT),
self.conf.get(CONF_KEEPALIVE, DEFAULT_KEEPALIVE),
)
except OSError as err:
except (OSError, mqtt.WebsocketConnectionError) as err:
_LOGGER.error("Failed to connect to MQTT server due to exception: %s", err)
self._async_connection_result(False)
finally: