Exception: Copilot::JsonRpcError
- Inherits:
-
StandardError
- Object
- StandardError
- Copilot::JsonRpcError
- Defined in:
- lib/copilot/json_rpc_client.rb
Overview
JSON-RPC 2.0 error raised when the server returns an error response.
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(code, message, data = nil) ⇒ JsonRpcError
constructor
A new instance of JsonRpcError.
Constructor Details
#initialize(code, message, data = nil) ⇒ JsonRpcError
Returns a new instance of JsonRpcError.
14 15 16 17 18 |
# File 'lib/copilot/json_rpc_client.rb', line 14 def initialize(code, , data = nil) @code = code @data = data super("JSON-RPC Error #{code}: #{}") end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
12 13 14 |
# File 'lib/copilot/json_rpc_client.rb', line 12 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
12 13 14 |
# File 'lib/copilot/json_rpc_client.rb', line 12 def data @data end |