mirror of
https://github.com/home-assistant/core.git
synced 2025-11-06 09:29:27 +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
|
||||
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",
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user