Exception: A2A::ContentTypeNotSupportedError
- Defined in:
- lib/a2a/errors.rb
Overview
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.
Instance Attribute Summary
Attributes inherited from Error
Instance Method Summary collapse
- #error_data ⇒ Object
-
#initialize(content_type = nil, message: "Content type not supported") ⇒ ContentTypeNotSupportedError
constructor
A new instance of ContentTypeNotSupportedError.
Methods inherited from Error
Constructor Details
#initialize(content_type = nil, message: "Content type not supported") ⇒ ContentTypeNotSupportedError
Returns a new instance of ContentTypeNotSupportedError.
127 128 129 130 |
# File 'lib/a2a/errors.rb', line 127 def initialize(content_type = nil, message: "Content type not supported") @content_type = content_type super(, code: -32005, http_status: 400) end |
Instance Method Details
#error_data ⇒ Object
132 133 134 135 136 137 138 139 140 141 |
# File 'lib/a2a/errors.rb', line 132 def error_data = {} ["contentType"] = @content_type.to_s if @content_type [{ "@type" => "type.googleapis.com/google.rpc.ErrorInfo", "reason" => "CONTENT_TYPE_NOT_SUPPORTED", "domain" => "a2a-protocol.org", "metadata" => , }] end |