Exception: A2A::Errors::A2AError
- Inherits:
-
StandardError
- Object
- StandardError
- A2A::Errors::A2AError
- Defined in:
- lib/a2a/errors.rb
Overview
Base class for all A2A errors
Direct Known Subclasses
AgentUnavailable, AuthenticationRequired, AuthorizationFailed, CapabilityNotSupported, ClientError, ConfigurationError, InternalError, InvalidParams, InvalidRequest, InvalidTaskState, MethodNotFound, NotFound, ParseError, PluginError, ProtocolVersionMismatch, RateLimitExceeded, ResourceExhausted, ServerError, TaskNotCancelable, TaskNotFound, UnsupportedOperation
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(message = nil, code: nil, data: nil) ⇒ A2AError
constructor
A new instance of A2AError.
-
#to_json_rpc_error ⇒ Hash
Convert to JSON-RPC error format.
Constructor Details
#initialize(message = nil, code: nil, data: nil) ⇒ A2AError
Returns a new instance of A2AError.
14 15 16 17 18 |
# File 'lib/a2a/errors.rb', line 14 def initialize( = nil, code: nil, data: nil) super() @code = code @data = data end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
12 13 14 |
# File 'lib/a2a/errors.rb', line 12 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
12 13 14 |
# File 'lib/a2a/errors.rb', line 12 def data @data end |
Instance Method Details
#to_json_rpc_error ⇒ Hash
Convert to JSON-RPC error format
22 23 24 25 26 27 28 |
# File 'lib/a2a/errors.rb', line 22 def to_json_rpc_error { code: @code, message: , data: @data }.compact end |