Handle timeout errors gracefully in Nord Pool services (#153856)

This commit is contained in:
G Johansson
2025-10-06 21:15:38 +02:00
committed by Franck Nijhof
parent 4588e9da8d
commit cbe3956e15
2 changed files with 2 additions and 1 deletions

View File

@@ -157,7 +157,7 @@ def async_setup_services(hass: HomeAssistant) -> None:
) from error
except NordPoolEmptyResponseError:
return {area: [] for area in areas}
except NordPoolError as error:
except (NordPoolError, TimeoutError) as error:
raise ServiceValidationError(
translation_domain=DOMAIN,
translation_key="connection_error",

View File

@@ -94,6 +94,7 @@ async def test_service_call(
[
(NordPoolAuthenticationError, "authentication_error"),
(NordPoolError, "connection_error"),
(TimeoutError, "connection_error"),
],
)
@pytest.mark.freeze_time("2025-10-01T18:00:00+00:00")