Exception: A2A::Error
- Inherits:
-
StandardError
- Object
- StandardError
- A2A::Error
- Defined in:
- lib/a2a/errors.rb
Overview
Base error class for A2A protocol errors.
Each subclass carries its own JSON-RPC error code, HTTP status, and structured error data. The handler layer rescues these and calls #to_h to populate env for the binding layer.
Direct Known Subclasses
ContentTypeNotSupportedError, ExtendedAgentCardNotConfiguredError, ExtensionSupportRequiredError, Internal::Errors::PushNotificationConfigNotFoundError, InvalidAgentResponseError, InvalidParamsError, JsonRpcError, PushNotificationNotSupportedError, RestError, TaskNotCancelableError, TaskNotFoundError, UnsupportedOperationError, VersionNotSupportedError
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
Instance Method Summary collapse
- #error_data ⇒ Object
-
#initialize(message, code:, http_status: 400) ⇒ Error
constructor
A new instance of Error.
- #to_h ⇒ Object
Constructor Details
#initialize(message, code:, http_status: 400) ⇒ Error
Returns a new instance of Error.
40 41 42 43 44 |
# File 'lib/a2a/errors.rb', line 40 def initialize(, code:, http_status: 400) @code = code @http_status = http_status super() end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
38 39 40 |
# File 'lib/a2a/errors.rb', line 38 def code @code end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
38 39 40 |
# File 'lib/a2a/errors.rb', line 38 def http_status @http_status end |
Instance Method Details
#error_data ⇒ Object
46 |
# File 'lib/a2a/errors.rb', line 46 def error_data = nil |
#to_h ⇒ Object
48 49 50 51 52 |
# File 'lib/a2a/errors.rb', line 48 def to_h h = { code: code, http_status: http_status, message: } h[:data] = error_data if error_data h end |