Skip to content

Commit 20c09b8

Browse files
committed
fix: preserve empty timeout details
1 parent 2e2f308 commit 20c09b8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/ha_mcp/client/rest_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ async def _supervisor_logs_get(self, path: str, lines: int | None = None) -> str
836836
except (TimeoutError, httpx.TimeoutException) as e:
837837
raise HomeAssistantConnectionError(
838838
f"Timeout fetching /{path}/logs from Supervisor after "
839-
f"{self.timeout}s: {e or type(e).__name__}"
839+
f"{self.timeout}s: {str(e) or type(e).__name__}"
840840
) from e
841841
except httpx.HTTPError as e:
842842
raise HomeAssistantConnectionError(

tests/src/unit/test_tools_utility_supervisor_logs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ async def _hang_forever(*_args, **_kwargs):
454454
with pytest.raises(HomeAssistantConnectionError) as exc_info:
455455
await mock_client.get_addon_logs("core_mosquitto")
456456

457-
assert "Timeout" in str(exc_info.value)
457+
assert "after 0.01s: TimeoutError" in str(exc_info.value)
458458

459459
@pytest.mark.asyncio
460460
async def test_raises_connection_error_on_network_failure_with_distinct_message(

0 commit comments

Comments
 (0)