Class TaskNotFoundError

All Implemented Interfaces:
Serializable, Event

public class TaskNotFoundError extends A2AProtocolError
A2A Protocol error indicating that the requested task ID does not exist.

This error is returned when a client attempts to perform operations on a task using a task ID that is not found in the server's task store.

Common causes:

  • Task ID was never created
  • Task has been removed from the task store (expired or deleted)
  • Task ID typo or incorrect value
  • Task belongs to a different agent or server instance

Corresponds to A2A-specific error code -32001.

Usage example:


 Task task = taskStore.getTask(taskId);
 if (task == null) {
     throw new TaskNotFoundError();
 }
 
See Also:
  • Constructor Details

    • TaskNotFoundError

      public TaskNotFoundError()
      Constructs error with default message.
    • TaskNotFoundError

      public TaskNotFoundError(@Nullable String message, @Nullable Map<String,Object> details)
      Constructs error with all parameters.
      Parameters:
      message - the error message (defaults to "Task not found" if null)
      details - additional error details (optional)