Skip to content

Commit 2e2f308

Browse files
committed
fix: clarify supervisor log timeout errors
1 parent bbca4a4 commit 2e2f308

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/ha_mcp/client/rest_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,8 @@ async def _supervisor_logs_get(self, path: str, lines: int | None = None) -> str
835835
)
836836
except (TimeoutError, httpx.TimeoutException) as e:
837837
raise HomeAssistantConnectionError(
838-
f"Timeout fetching /{path}/logs from Supervisor: {e}"
838+
f"Timeout fetching /{path}/logs from Supervisor after "
839+
f"{self.timeout}s: {e or type(e).__name__}"
839840
) from e
840841
except httpx.HTTPError as e:
841842
raise HomeAssistantConnectionError(

tests/src/unit/test_tools_utility_supervisor_logs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ async def test_raises_connection_error_on_timeout_with_distinct_message(
437437
assert "Timeout" in str(exc_info.value)
438438

439439
@pytest.mark.asyncio
440+
@pytest.mark.timeout(10)
440441
async def test_supervisor_log_fetch_has_overall_deadline(
441442
self, mock_client, addon_install, mock_async_client_class
442443
):

0 commit comments

Comments
 (0)