Package org.a2aproject.sdk.spec
Class A2AClientJSONError
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.a2aproject.sdk.spec.A2AClientError
org.a2aproject.sdk.spec.A2AClientJSONError
- All Implemented Interfaces:
Serializable
Client exception indicating a JSON serialization or deserialization error.
This exception is thrown when the A2A client SDK encounters errors while parsing JSON responses from agents or serializing requests. This typically indicates:
- Malformed JSON in agent responses
- Unexpected JSON structure or field types
- Missing required JSON fields
- JSON encoding/decoding errors
Usage example:
try {
AgentCard card = objectMapper.readValue(json, AgentCard.class);
} catch (org.a2aproject.sdk.json.JsonProcessingException e) {
throw new A2AClientJSONError("Failed to parse agent card", e);
}
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new JSON error with no message.A2AClientJSONError(String message) Creates a new JSON error with the specified message.A2AClientJSONError(String message, Throwable cause) Creates a new JSON error with the specified message and cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
A2AClientJSONError
public A2AClientJSONError()Creates a new JSON error with no message. -
A2AClientJSONError
Creates a new JSON error with the specified message.- Parameters:
message- the error message
-
A2AClientJSONError
Creates a new JSON error with the specified message and cause.- Parameters:
message- the error messagecause- the underlying cause
-