mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Improve incomfort coordinator logging (#135777)
This commit is contained in:
parent
2e189480a5
commit
5ca68cb273
@ -66,10 +66,10 @@ class InComfortDataCoordinator(DataUpdateCoordinator[InComfortData]):
|
||||
for heater in self.incomfort_data.heaters:
|
||||
await heater.update()
|
||||
except TimeoutError as exc:
|
||||
raise UpdateFailed from exc
|
||||
raise UpdateFailed("Timeout error") from exc
|
||||
except IncomfortError as exc:
|
||||
if isinstance(exc.message, ClientResponseError):
|
||||
if exc.message.status == 401:
|
||||
raise ConfigEntryError("Incorrect credentials") from exc
|
||||
raise UpdateFailed from exc
|
||||
raise UpdateFailed(exc.message) from exc
|
||||
return self.incomfort_data
|
||||
|
@ -3,7 +3,7 @@
|
||||
from datetime import timedelta
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from aiohttp import ClientResponseError
|
||||
from aiohttp import ClientResponseError, RequestInfo
|
||||
from freezegun.api import FrozenDateTimeFactory
|
||||
from incomfortclient import IncomfortError
|
||||
import pytest
|
||||
@ -63,7 +63,18 @@ async def test_coordinator_updates(
|
||||
"exc",
|
||||
[
|
||||
IncomfortError(ClientResponseError(None, None, status=401)),
|
||||
IncomfortError(ClientResponseError(None, None, status=500)),
|
||||
IncomfortError(
|
||||
ClientResponseError(
|
||||
RequestInfo(
|
||||
url="http://example.com",
|
||||
method="GET",
|
||||
headers=[],
|
||||
real_url="http://example.com",
|
||||
),
|
||||
None,
|
||||
status=500,
|
||||
)
|
||||
),
|
||||
IncomfortError(ValueError("some_error")),
|
||||
TimeoutError,
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user