@@ -823,18 +823,20 @@ async def _supervisor_logs_get(self, path: str, lines: int | None = None) -> str
823823 )
824824
825825 try :
826- async with make_supervisor_httpx_client (
827- timeout = httpx .Timeout (self .timeout ),
828- verify = self .verify_ssl ,
829- ) as client :
830- response = await client .get (
831- relative_path ,
832- headers = {"Accept" : "text/plain" },
833- params = {"lines" : lines } if lines is not None else None ,
834- )
835- except httpx .TimeoutException as e :
826+ async with asyncio .timeout (self .timeout ):
827+ async with make_supervisor_httpx_client (
828+ timeout = httpx .Timeout (self .timeout ),
829+ verify = self .verify_ssl ,
830+ ) as client :
831+ response = await client .get (
832+ relative_path ,
833+ headers = {"Accept" : "text/plain" },
834+ params = {"lines" : lines } if lines is not None else None ,
835+ )
836+ except (TimeoutError , httpx .TimeoutException ) as e :
836837 raise HomeAssistantConnectionError (
837- f"Timeout fetching /{ path } /logs from Supervisor: { e } "
838+ f"Timeout fetching /{ path } /logs from Supervisor after "
839+ f"{ self .timeout } s: { str (e ) or type (e ).__name__ } "
838840 ) from e
839841 except httpx .HTTPError as e :
840842 raise HomeAssistantConnectionError (
0 commit comments