Class JSONParseError

All Implemented Interfaces:
Serializable, Event

public class JSONParseError extends A2AError
JSON-RPC error indicating that the server received invalid JSON that could not be parsed.

This error is returned when the request payload is not valid JSON, such as malformed syntax, unexpected tokens, or encoding issues. This is distinct from InvalidRequestError, which indicates structurally valid JSON that doesn't conform to the JSON-RPC specification.

Corresponds to JSON-RPC 2.0 error code -32700.

Usage example:


 try {
     objectMapper.readValue(payload, JSONRPCRequest.class);
 } catch (org.a2aproject.sdk.json.JsonProcessingException e) {
     throw new JSONParseError("Malformed JSON: " + e.getMessage());
 }
 
See Also:
  • Constructor Details

    • JSONParseError

      public JSONParseError()
      Constructs a JSON parse error with default message.
    • JSONParseError

      public JSONParseError(String message)
      Constructs a JSON parse error with a message.
      Parameters:
      message - the error message
    • JSONParseError

      public JSONParseError(@Nullable Integer code, @Nullable String message, @Nullable Map<String,Object> details)
      Constructs a JSON parse error with full parameters.
      Parameters:
      code - the error code
      message - the error message
      details - additional error details