1111from pydantic import BaseModel
1212
1313from a2a .client .card_resolver import A2ACardResolver
14- from a2a .client .errors import A2AClientHTTPError , A2AClientJSONError
14+ from a2a .client .errors import (
15+ A2AClientHTTPError ,
16+ A2AClientJSONError ,
17+ A2AClientTimeoutError ,
18+ )
1519from a2a .client .middleware import ClientCallContext , ClientCallInterceptor
1620from a2a .client .transports .base import ClientTransport
1721from a2a .extensions .common import update_extension_header
@@ -163,6 +167,8 @@ async def send_message_streaming(
163167 event = a2a_pb2 .StreamResponse ()
164168 Parse (sse .data , event )
165169 yield proto_utils .FromProto .stream_response (event )
170+ except httpx .TimeoutException as e :
171+ raise A2AClientTimeoutError ('Client Request timed out' ) from e
166172 except httpx .HTTPStatusError as e :
167173 raise A2AClientHTTPError (e .response .status_code , str (e )) from e
168174 except SSEError as e :
@@ -181,6 +187,8 @@ async def _send_request(self, request: httpx.Request) -> dict[str, Any]:
181187 response = await self .httpx_client .send (request )
182188 response .raise_for_status ()
183189 return response .json ()
190+ except httpx .TimeoutException as e :
191+ raise A2AClientTimeoutError ('Client Request timed out' ) from e
184192 except httpx .HTTPStatusError as e :
185193 raise A2AClientHTTPError (e .response .status_code , str (e )) from e
186194 except json .JSONDecodeError as e :
@@ -383,6 +391,8 @@ async def resubscribe(
383391 event = a2a_pb2 .StreamResponse ()
384392 Parse (sse .data , event )
385393 yield proto_utils .FromProto .stream_response (event )
394+ except httpx .TimeoutException as e :
395+ raise A2AClientTimeoutError ('Client Request timed out' ) from e
386396 except SSEError as e :
387397 raise A2AClientHTTPError (
388398 400 , f'Invalid SSE response or protocol error: { e } '
0 commit comments