Package org.a2aproject.sdk.spec
Class A2AClientInvalidStateError
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.a2aproject.sdk.spec.A2AClientError
org.a2aproject.sdk.spec.A2AClientInvalidStateError
- All Implemented Interfaces:
Serializable
Client exception indicating an invalid state for the requested operation.
This exception is thrown when a client operation is attempted while the client is in a state that doesn't permit that operation. This ensures proper sequencing and lifecycle management of client operations.
Common scenarios:
- Attempting to send messages before client initialization
- Trying to cancel a task after the client connection is closed
- Performing operations on a client that has been shut down
- Violating client state machine transitions
Usage example:
if (!client.isConnected()) {
throw new A2AClientInvalidStateError("Client not connected");
}
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new invalid state error with no message.A2AClientInvalidStateError(String message) Creates a new invalid state error with the specified message.A2AClientInvalidStateError(String message, Throwable cause) Creates a new invalid state error with the specified message and cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
A2AClientInvalidStateError
public A2AClientInvalidStateError()Creates a new invalid state error with no message. -
A2AClientInvalidStateError
Creates a new invalid state error with the specified message.- Parameters:
message- the error message
-
A2AClientInvalidStateError
Creates a new invalid state error with the specified message and cause.- Parameters:
message- the error messagecause- the underlying cause
-