Class A2AClientJSONError

All Implemented Interfaces:
Serializable

public class A2AClientJSONError extends A2AClientError
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);
 }
 
See Also:
  • Constructor Details

    • A2AClientJSONError

      public A2AClientJSONError()
      Creates a new JSON error with no message.
    • A2AClientJSONError

      public A2AClientJSONError(String message)
      Creates a new JSON error with the specified message.
      Parameters:
      message - the error message
    • A2AClientJSONError

      public A2AClientJSONError(String message, Throwable cause)
      Creates a new JSON error with the specified message and cause.
      Parameters:
      message - the error message
      cause - the underlying cause