Exception: Barrister::RpcException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/barrister.rb

Overview

Represents a JSON-RPC error response. The Client proxy classes raise this exception if a response is received with an ‘error` slot.

See the [JSON-RPC 2.0 spec](jsonrpc.org/specification) for info on built in error codes. Your code can raise this exception with custom error codes. Use positive integers as codes to avoid collisions with the built in error codes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message, data = nil) ⇒ RpcException

Returns a new instance of RpcException.



118
119
120
121
122
# File 'lib/barrister.rb', line 118

def initialize(code, message, data=nil)
  @code    = code
  @message = message
  @data    = data
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



116
117
118
# File 'lib/barrister.rb', line 116

def code
  @code
end

#dataObject

Returns the value of attribute data.



116
117
118
# File 'lib/barrister.rb', line 116

def data
  @data
end

#messageObject

Returns the value of attribute message.



116
117
118
# File 'lib/barrister.rb', line 116

def message
  @message
end