Class JsonProcessingException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.a2aproject.sdk.jsonrpc.common.json.JsonProcessingException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
JsonMappingException
General exception for JSON processing errors during serialization or deserialization.
This exception serves as a replacement for Jackson's JsonProcessingException, allowing the A2A Java SDK to remain independent of any specific JSON library implementation. It can be used with any JSON processing library (Gson, Jackson, etc.).
This is the base class for more specific JSON processing exceptions like
JsonMappingException.
Usage example:
try {
String json = gson.toJson(object);
} catch (Exception e) {
throw new JsonProcessingException("Failed to serialize object", e);
}
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJsonProcessingException(String message) Constructs a new JsonProcessingException with the specified message.JsonProcessingException(String message, @Nullable Throwable cause) Constructs a new JsonProcessingException with the specified message and cause.JsonProcessingException(Throwable cause) Constructs a new JsonProcessingException with the specified 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
-
JsonProcessingException
Constructs a new JsonProcessingException with the specified message.- Parameters:
message- the detail message explaining the cause of the exception
-
JsonProcessingException
Constructs a new JsonProcessingException with the specified message and cause.- Parameters:
message- the detail message explaining the cause of the exceptioncause- the underlying cause of the exception (may be null)
-
JsonProcessingException
Constructs a new JsonProcessingException with the specified cause.- Parameters:
cause- the underlying cause of the exception
-