mirror of
https://github.com/home-assistant/core.git
synced 2026-12-02 19:57:03 -04:00
Report Freebox connection timeouts as cannot connect (#190079)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ef4f783701
commit
779c7a7db7
@@ -3,6 +3,7 @@
|
||||
import logging
|
||||
from typing import Any, override
|
||||
|
||||
from aiohttp import ClientError
|
||||
from freebox_api.exceptions import AuthorizationError, HttpRequestError
|
||||
import probatio
|
||||
|
||||
@@ -92,7 +93,7 @@ class FreeboxFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
# rejected token forever.
|
||||
await async_forget_registration(self.hass, self._data[CONF_HOST])
|
||||
|
||||
except HttpRequestError:
|
||||
except HttpRequestError, ClientError, TimeoutError:
|
||||
_LOGGER.error(
|
||||
"Error connecting to the Freebox router at %s", self._data[CONF_HOST]
|
||||
)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
from ipaddress import ip_address
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from aiohttp import ClientConnectionError
|
||||
from freebox_api.exceptions import (
|
||||
AuthorizationError,
|
||||
HttpRequestError,
|
||||
@@ -187,6 +188,8 @@ async def test_abort_if_already_setup(hass: HomeAssistant) -> None:
|
||||
[
|
||||
(AuthorizationError, "register_failed"),
|
||||
(HttpRequestError, "cannot_connect"),
|
||||
(ClientConnectionError, "cannot_connect"),
|
||||
(TimeoutError, "cannot_connect"),
|
||||
(InvalidTokenError, "unknown"),
|
||||
],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user