Exception: A2A::JsonRpcError

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

Overview

Raised by the JSON-RPC response middleware when the server returns a JSON-RPC 2.0 error envelope. Preserves the wire code, message, and optional structured data array.

JSON-RPC errors are always delivered over HTTP 200 — the error lives inside the JSON-RPC envelope, not the HTTP status.

Instance Attribute Summary

Attributes inherited from Error

#code, #http_status

Instance Method Summary collapse

Methods inherited from Error

#to_h

Constructor Details

#initialize(message, code:, data: nil) ⇒ JsonRpcError

Returns a new instance of JsonRpcError.



15
16
17
18
# File 'lib/a2a/errors/json_rpc_error.rb', line 15

def initialize(message, code:, data: nil)
  @wire_data = data
  super(message, code: code, http_status: 200)
end

Instance Method Details

#error_dataObject



20
21
22
# File 'lib/a2a/errors/json_rpc_error.rb', line 20

def error_data
  @wire_data
end