Package io.a2a.spec
Class UnsupportedOperationError
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.a2a.spec.A2AError
io.a2a.spec.A2AProtocolError
io.a2a.spec.UnsupportedOperationError
- All Implemented Interfaces:
Event,Serializable
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
ConstructorsConstructorDescriptionConstructs error with default message.UnsupportedOperationError(@Nullable Integer code, @Nullable String message, @Nullable Object data) Constructs error with all parameters. -
Method Summary
Methods inherited from class io.a2a.spec.A2AProtocolError
getUrlMethods 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 Object data) 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)data- additional error data (optional)
-
UnsupportedOperationError
public UnsupportedOperationError()Constructs error with default message.
-