Class TaskStoreException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
TaskPersistenceException, TaskSerializationException

public class TaskStoreException extends A2AServerException
Base exception for TaskStore persistence layer failures.

Root exception for all task storage and retrieval errors. Specialized subclasses provide specific failure contexts:

Usage Context

Thrown by TaskStore implementations during:
  • save(Task, boolean) - Task persistence failures
  • get(String) - Task retrieval failures
  • delete(String) - Task deletion failures
  • list(ListTasksParams, ServerCallContext) - Task listing failures

Error Handling Pattern

Caught by MainEventBusProcessor which:
  1. Logs the failure with full context (taskId, operation)
  2. Distributes InternalError event to clients
  3. Preserves exception cause chain for diagnostics
See Also:
  • Constructor Details

    • TaskStoreException

      public TaskStoreException()
      Creates a new TaskStoreException with no message or cause.
    • TaskStoreException

      public TaskStoreException(String msg)
      Creates a new TaskStoreException with the specified message.
      Parameters:
      msg - the exception message
    • TaskStoreException

      public TaskStoreException(Throwable cause)
      Creates a new TaskStoreException with the specified cause.
      Parameters:
      cause - the underlying cause
    • TaskStoreException

      public TaskStoreException(String msg, Throwable cause)
      Creates a new TaskStoreException with the specified message and cause.
      Parameters:
      msg - the exception message
      cause - the underlying cause
    • TaskStoreException

      public TaskStoreException(@Nullable String taskId, String msg)
      Creates a new TaskStoreException 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
    • TaskStoreException

      public TaskStoreException(@Nullable String taskId, String msg, Throwable cause)
      Creates a new TaskStoreException 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 message
      cause - the underlying cause
  • Method Details

    • getTaskId

      public @Nullable String getTaskId()
      Returns the task ID associated with this exception.
      Returns:
      the task ID, or null if not associated with a specific task