Class A2AClientInvalidStateError

All Implemented Interfaces:
Serializable

public class A2AClientInvalidStateError extends A2AClientError
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");
 }
 
See Also:
  • Constructor Details

    • A2AClientInvalidStateError

      public A2AClientInvalidStateError()
      Creates a new invalid state error with no message.
    • A2AClientInvalidStateError

      public A2AClientInvalidStateError(String message)
      Creates a new invalid state error with the specified message.
      Parameters:
      message - the error message
    • A2AClientInvalidStateError

      public A2AClientInvalidStateError(String message, Throwable cause)
      Creates a new invalid state error with the specified message and cause.
      Parameters:
      message - the error message
      cause - the underlying cause