Package io.a2a.spec
Class InvalidAgentResponseError
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.a2a.spec.A2AError
io.a2a.spec.A2AProtocolError
io.a2a.spec.InvalidAgentResponseError
- All Implemented Interfaces:
Event,Serializable
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
ConstructorsConstructorDescriptionInvalidAgentResponseError(@Nullable Integer code, @Nullable String message, @Nullable Object data) Constructs an invalid agent response error. -
Method Summary
Methods inherited from class io.a2a.spec.A2AProtocolError
getUrlMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString