mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Handle timeout errors gracefully in Nord Pool services (#153856)
This commit is contained in:
committed by
Franck Nijhof
parent
4588e9da8d
commit
cbe3956e15
@@ -157,7 +157,7 @@ def async_setup_services(hass: HomeAssistant) -> None:
|
|||||||
) from error
|
) from error
|
||||||
except NordPoolEmptyResponseError:
|
except NordPoolEmptyResponseError:
|
||||||
return {area: [] for area in areas}
|
return {area: [] for area in areas}
|
||||||
except NordPoolError as error:
|
except (NordPoolError, TimeoutError) as error:
|
||||||
raise ServiceValidationError(
|
raise ServiceValidationError(
|
||||||
translation_domain=DOMAIN,
|
translation_domain=DOMAIN,
|
||||||
translation_key="connection_error",
|
translation_key="connection_error",
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ async def test_service_call(
|
|||||||
[
|
[
|
||||||
(NordPoolAuthenticationError, "authentication_error"),
|
(NordPoolAuthenticationError, "authentication_error"),
|
||||||
(NordPoolError, "connection_error"),
|
(NordPoolError, "connection_error"),
|
||||||
|
(TimeoutError, "connection_error"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@pytest.mark.freeze_time("2025-10-01T18:00:00+00:00")
|
@pytest.mark.freeze_time("2025-10-01T18:00:00+00:00")
|
||||||
|
|||||||
Reference in New Issue
Block a user