Class: A2A::ContentTypeNotSupportedError

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

Overview

Error for unsupported content types (-32005)

Raised when a Media Type provided in the request’s message.parts (or implied for an artifact) is not supported by the agent or the specific skill being invoked.

Examples:

Create a content type not supported error

error = JSONRPC::ContentTypeNotSupportedError.new

Instance Method Summary collapse

Constructor Details

#initialize(message = 'Incompatible content types.', data: nil, request_id: nil) ⇒ ContentTypeNotSupportedError

Creates a new Content Type Not Supported Error with code -32005

Examples:

Create a content type not supported error with default message

error = JSONRPC::ContentTypeNotSupportedError.new

Create a content type not supported error with exception details

error = JSONRPC::ContentTypeNotSupportedError.new(data: { content_type: 'application/xml' }, request_id: 1)

Parameters:

  • message (String) (defaults to: 'Incompatible content types.')

    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/content_type_not_supported_error.rb', line 29

def initialize(
  message = 'Incompatible content types.',
  data: nil,
  request_id: nil
)
  super(
    message,
    code: ErrorCodes::CONTENT_TYPE_NOT_SUPPORTED,
    data:,
    request_id:
  )
end