Class: A2A::PushNotificationNotSupportedError

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

Overview

Error for unsupported push notifications (-32003)

Raised when client attempts to use push notification features but the server agent does not support them (i.e., AgentCard.capabilities.pushNotifications is false).

Examples:

Create a push notification not supported error

error = JSONRPC::PushNotificationNotSupportedError.new

Instance Method Summary collapse

Constructor Details

#initialize(message = 'Push Notification is not supported.', data: nil, request_id: nil) ⇒ PushNotificationNotSupportedError

Creates a new Push Notification Not Supported Error with code -32003

Examples:

Create a push notification not supported error with default message

error = JSONRPC::PushNotificationNotSupportedError.new

Create a push notification not supported error with exception details

error = JSONRPC::PushNotificationNotSupportedError.new(data: { capability: false }, request_id: 1)

Parameters:

  • message (String) (defaults to: 'Push Notification 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/push_notification_not_supported_error.rb', line 29

def initialize(
  message = 'Push Notification is not supported.',
  data: nil,
  request_id: nil
)
  super(
    message,
    code: ErrorCodes::PUSH_NOTIFICATION_NOT_SUPPORTED,
    data:,
    request_id:
  )
end