Exception: JSONServer::JSONRPCError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/json_server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj = {}) ⇒ JSONRPCError

Returns a new instance of JSONRPCError.



9
10
11
12
13
# File 'lib/json_server.rb', line 9

def initialize obj = {}
  @code    = obj[:code]    || -30000
  @message = obj[:message] || "Runtime Error"
  @data    = obj[:data]
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



8
9
10
# File 'lib/json_server.rb', line 8

def code
  @code
end

#dataObject (readonly)

Returns the value of attribute data.



8
9
10
# File 'lib/json_server.rb', line 8

def data
  @data
end

#messageObject (readonly)

Returns the value of attribute message.



8
9
10
# File 'lib/json_server.rb', line 8

def message
  @message
end