Package io.a2a.spec
Class JSONParseError
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.a2a.spec.A2AError
io.a2a.spec.JSONParseError
- All Implemented Interfaces:
Event,Serializable
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 (io.a2a.json.JsonProcessingException e) {
throw new JSONParseError("Malformed JSON: " + e.getMessage());
}
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a JSON parse error with default message.JSONParseError(@Nullable Integer code, @Nullable String message, @Nullable Object data) Constructs a JSON parse error with full parameters.JSONParseError(String message) Constructs a JSON parse error with a message. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
JSONParseError
public JSONParseError()Constructs a JSON parse error with default message. -
JSONParseError
Constructs a JSON parse error with a message.- Parameters:
message- the error message
-
JSONParseError
Constructs a JSON parse error with full parameters.- Parameters:
code- the error codemessage- the error messagedata- additional error data
-