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

public class JsonProcessingException extends Exception
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 Details

    • JsonProcessingException

      public JsonProcessingException(String message)
      Constructs a new JsonProcessingException with the specified message.
      Parameters:
      message - the detail message explaining the cause of the exception
    • JsonProcessingException

      public JsonProcessingException(String message, @Nullable Throwable cause)
      Constructs a new JsonProcessingException with the specified message and cause.
      Parameters:
      message - the detail message explaining the cause of the exception
      cause - the underlying cause of the exception (may be null)
    • JsonProcessingException

      public JsonProcessingException(Throwable cause)
      Constructs a new JsonProcessingException with the specified cause.
      Parameters:
      cause - the underlying cause of the exception