Skip to content

Commit e604106

Browse files
committed
fix: properly handle errors in list_tasks JSON-RPC
1 parent 9727f48 commit e604106

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/a2a/server/request_handlers/jsonrpc_handler.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,9 @@ async def list_tasks(
400400
"""
401401
try:
402402
result = await self.request_handler.on_list_tasks(request, context)
403-
except ServerError:
404-
return ListTasksResponse(
405-
# This needs to be appropriately handled since error fields on proto messages
406-
# might be different from the old pydantic models
407-
# Ignoring proto error handling for now as it diverges from the current pattern
403+
except ServerError as e:
404+
return _build_error_response(
405+
request_id, e.error if e.error else InternalError()
408406
)
409407
return result
410408

0 commit comments

Comments
 (0)