Class: A2A::UnsupportedOperationError

Inherits:
JSONRPC::Error
  • Object
show all
Defined in:
lib/a2a/types/unsupported_operation_error.rb

Overview

Error for unsupported operations (-32004)

Raised when the requested operation or a specific aspect of it (perhaps implied by parameters) is not supported by this server agent implementation. Broader than just method not found.

Examples:

Create an unsupported operation error

error = JSONRPC::UnsupportedOperationError.new

Instance Method Summary collapse

Constructor Details

#initialize(message = 'This operation is not supported.', data: nil, request_id: nil) ⇒ UnsupportedOperationError

Creates a new Unsupported Operation Error with code -32004

Examples:

Create an unsupported operation error with default message

error = JSONRPC::UnsupportedOperationError.new

Create an unsupported operation error with exception details

error = JSONRPC::UnsupportedOperationError.new(data: { operation: 'streaming' }, request_id: 1)

Parameters:

  • message (String) (defaults to: 'This operation is not supported.')

    short description of the error

  • data (Hash, Array, String, Number, Boolean, nil) (defaults to: nil)

    additional error information

  • request_id (String, Integer, nil) (defaults to: nil)

    the request identifier



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/a2a/types/unsupported_operation_error.rb', line 29

def initialize(
  message = 'This operation is not supported.',
  data: nil,
  request_id: nil
)
  super(
    message,
    code: ErrorCodes::UNSUPPORTED_OPERATION,
    data:,
    request_id:
  )
end