Package org.a2aproject.sdk.spec
Class InvalidAgentResponseError
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.a2aproject.sdk.spec.A2AError
org.a2aproject.sdk.spec.A2AProtocolError
org.a2aproject.sdk.spec.InvalidAgentResponseError
- All Implemented Interfaces:
Serializable,Event
A2A Protocol error indicating that an agent returned a response not conforming to protocol specifications.
This error is typically raised by client implementations when validating agent responses. It indicates that the agent's response structure, content, or format violates the A2A Protocol requirements for the invoked method.
Common violations:
- Missing required fields in response objects
- Invalid field types or values
- Malformed event stream data
- Response doesn't match declared agent capabilities
Corresponds to A2A-specific error code -32006.
Usage example:
SendMessageResponse response = client.sendMessage(request);
if (response.task() == null) {
throw new InvalidAgentResponseError(
null,
"Response missing required 'task' field",
null
);
}
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.a2aproject.sdk.spec.A2AError
getCode, getDetailsMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details