Exception: A2A::ExtensionSupportRequiredError

Inherits:
Error
  • Object
show all
Defined in:
lib/a2a/errors.rb

Overview

Server requested use of an extension marked as required: true in the Agent Card but the client did not declare support for it in the request.

Instance Attribute Summary

Attributes inherited from Error

#code, #http_status

Instance Method Summary collapse

Methods inherited from Error

#to_h

Constructor Details

#initialize(extension = nil, message: "Extension support required") ⇒ ExtensionSupportRequiredError

Returns a new instance of ExtensionSupportRequiredError.



179
180
181
182
# File 'lib/a2a/errors.rb', line 179

def initialize(extension = nil, message: "Extension support required")
  @extension = extension
  super(message, code: -32008, http_status: 400)
end

Instance Method Details

#error_dataObject



184
185
186
187
188
189
190
191
192
193
# File 'lib/a2a/errors.rb', line 184

def error_data
  meta = {}
  meta["extension"] = @extension.to_s if @extension
  [{
    "@type"    => "type.googleapis.com/google.rpc.ErrorInfo",
    "reason"   => "EXTENSION_SUPPORT_REQUIRED",
    "domain"   => "a2a-protocol.org",
    "metadata" => meta,
  }]
end