Exception: Copilot::JsonRpcError

Inherits:
StandardError
  • Object
show all
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

Instance Method Summary collapse

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, message, data = nil)
  @code = code
  @data = data
  super("JSON-RPC Error #{code}: #{message}")
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



12
13
14
# File 'lib/copilot/json_rpc_client.rb', line 12

def code
  @code
end

#dataObject (readonly)

Returns the value of attribute data.



12
13
14
# File 'lib/copilot/json_rpc_client.rb', line 12

def data
  @data
end