Package org.a2aproject.sdk.spec
Class TaskNotFoundError
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.a2aproject.sdk.spec.A2AError
org.a2aproject.sdk.spec.A2AProtocolError
org.a2aproject.sdk.spec.TaskNotFoundError
- All Implemented Interfaces:
Serializable,Event
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();
}
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs error with default message.TaskNotFoundError(@Nullable String message, @Nullable Map<String, Object> details) Constructs error with all parameters. -
Method Summary
Methods inherited from class org.a2aproject.sdk.spec.A2AError
getCode, getDetailsMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
TaskNotFoundError
public TaskNotFoundError()Constructs error with default message. -
TaskNotFoundError
Constructs error with all parameters.- Parameters:
message- the error message (defaults to "Task not found" if null)details- additional error details (optional)
-