Package org.a2aproject.sdk.spec
Class JSONParseError
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.a2aproject.sdk.spec.A2AError
org.a2aproject.sdk.spec.JSONParseError
- All Implemented Interfaces:
Serializable,Event
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());
}
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a JSON parse error with default message.JSONParseError(@Nullable Integer code, @Nullable String message, @Nullable Map<String, Object> details) 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 org.a2aproject.sdk.spec.A2AError
getCode, getDetailsMethods 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
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 codemessage- the error messagedetails- additional error details
-