File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 ContentTypeNotSupportedError ,
55 InternalError ,
66 InvalidAgentResponseError ,
7- InvalidParamsError ,
7+ InvalidParamsError as InvalidParamsErrorType ,
88 InvalidRequestError ,
99 JSONParseError ,
1010 JSONRPCError ,
@@ -35,6 +35,14 @@ def __init__(
3535 super ().__init__ (f'Not Implemented operation Error: { message } ' )
3636
3737
38+ class InvalidParamsError (InvalidParamsErrorType ):
39+ """
40+ JSON-RPC error indicating invalid method parameter(s).
41+ """
42+
43+ message : str = 'Invalid parameters'
44+
45+
3846class ServerError (Exception ):
3947 """Wrapper exception for A2A or JSON-RPC errors originating from the server's logic.
4048
Original file line number Diff line number Diff line change @@ -137,7 +137,23 @@ def test_task_query_params_invalid_name(self):
137137 request = a2a_pb2 .GetTaskRequest (name = 'invalid-name-format' )
138138 with pytest .raises (ServerError ) as exc_info :
139139 proto_utils .FromProto .task_query_params (request )
140+
140141 assert isinstance (exc_info .value .error , types .InvalidParamsError )
142+ assert (
143+ exc_info .value .error .message
144+ == 'invalid-name-format: invalid-name-format'
145+ )
146+
147+ def test_task_id_params_invalid_name (self ):
148+ request = a2a_pb2 .CancelTaskRequest (name = 'invalid-name-format' )
149+ with pytest .raises (ServerError ) as exc_info :
150+ proto_utils .FromProto .task_id_params (request )
151+
152+ assert isinstance (exc_info .value .error , types .InvalidParamsError )
153+ assert (
154+ exc_info .value .error .message
155+ == 'invalid-name-format: invalid-name-format'
156+ )
141157
142158
143159class TestProtoUtils :
You can’t perform that action at this time.
0 commit comments