Package org.a2aproject.sdk.spec
Class UnsupportedOperationError
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.UnsupportedOperationError
- All Implemented Interfaces:
Serializable,Event
A2A Protocol error indicating that the requested operation is not supported by the agent.
This error is returned when a client attempts an operation that is valid according to the
A2A Protocol but not implemented or enabled by the specific agent. This is distinct from
MethodNotFoundError, which indicates an unknown JSON-RPC method.
Common scenarios:
- Calling streaming methods when
AgentCapabilities.streaming()is false - Attempting push notification operations when
AgentCapabilities.pushNotifications()is false - Using optional protocol features not implemented by the agent
- Agent-specific operations disabled by configuration
Corresponds to A2A-specific error code -32004.
Usage example:
if (!agentCard.capabilities().streaming()) {
throw new UnsupportedOperationError();
}
-
Constructor Summary
Constructors -
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
-
UnsupportedOperationError
public UnsupportedOperationError(@Nullable Integer code, @Nullable String message, @Nullable Map<String, Object> details) Constructs error with all parameters.- Parameters:
code- the error code (defaults to -32004 if null)message- the error message (defaults to "This operation is not supported" if null)details- additional error details (optional)
-
UnsupportedOperationError
public UnsupportedOperationError()Constructs error with default message.
-