Exception: A2A::VersionNotSupportedError

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

Overview

The A2A protocol version specified in the request (via A2A-Version service parameter) is not supported by the agent.

Instance Attribute Summary

Attributes inherited from Error

#code, #http_status

Instance Method Summary collapse

Methods inherited from Error

#to_h

Constructor Details

#initialize(version = nil, message: "Version not supported") ⇒ VersionNotSupportedError

Returns a new instance of VersionNotSupportedError.



199
200
201
202
# File 'lib/a2a/errors.rb', line 199

def initialize(version = nil, message: "Version not supported")
  @version = version
  super(message, code: -32009, http_status: 400)
end

Instance Method Details

#error_dataObject



204
205
206
207
208
209
210
211
212
213
# File 'lib/a2a/errors.rb', line 204

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