Package org.a2aproject.sdk.server.tasks
Class TaskSerializationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.a2aproject.sdk.spec.A2AException
org.a2aproject.sdk.spec.A2AServerException
org.a2aproject.sdk.server.tasks.TaskStoreException
org.a2aproject.sdk.server.tasks.TaskSerializationException
- All Implemented Interfaces:
Serializable
Exception for task serialization/deserialization failures.
Indicates failures converting between Task domain objects and persistent storage format (JSON).
Common Scenarios
- JSON parsing errors during
get()operations - JSON serialization errors during
save()operations - Invalid enum values or missing required fields
- Data format version mismatches after upgrades
Usage Example
try {
Task task = jsonMapper.readValue(json, Task.class);
} catch (JsonProcessingException e) {
throw new TaskSerializationException(taskId, "Failed to deserialize task", e);
}
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new TaskSerializationException with no message or cause.TaskSerializationException(@Nullable String taskId, String msg) Creates a new TaskSerializationException with the specified task ID and message.TaskSerializationException(@Nullable String taskId, String msg, Throwable cause) Creates a new TaskSerializationException with the specified task ID, message, and cause.Creates a new TaskSerializationException with the specified message.TaskSerializationException(String msg, Throwable cause) Creates a new TaskSerializationException with the specified message and cause.Creates a new TaskSerializationException with the specified cause. -
Method Summary
Methods inherited from class org.a2aproject.sdk.server.tasks.TaskStoreException
getTaskIdMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TaskSerializationException
public TaskSerializationException()Creates a new TaskSerializationException with no message or cause. -
TaskSerializationException
Creates a new TaskSerializationException with the specified message.- Parameters:
msg- the exception message
-
TaskSerializationException
Creates a new TaskSerializationException with the specified cause.- Parameters:
cause- the underlying cause
-
TaskSerializationException
Creates a new TaskSerializationException with the specified message and cause.- Parameters:
msg- the exception messagecause- the underlying cause
-
TaskSerializationException
Creates a new TaskSerializationException with the specified task ID and message.- Parameters:
taskId- the task identifier (may be null for operations not tied to a specific task)msg- the exception message
-
TaskSerializationException
Creates a new TaskSerializationException with the specified task ID, message, and cause.- Parameters:
taskId- the task identifier (may be null for operations not tied to a specific task)msg- the exception messagecause- the underlying cause
-