Exception: Barrister::RpcException
- Inherits:
-
StandardError
- Object
- StandardError
- Barrister::RpcException
- 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
-
#code ⇒ Object
Returns the value of attribute code.
-
#data ⇒ Object
Returns the value of attribute data.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(code, message, data = nil) ⇒ RpcException
constructor
A new instance of RpcException.
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, , data=nil) @code = code @message = @data = data end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
116 117 118 |
# File 'lib/barrister.rb', line 116 def code @code end |
#data ⇒ Object
Returns the value of attribute data.
116 117 118 |
# File 'lib/barrister.rb', line 116 def data @data end |
#message ⇒ Object
Returns the value of attribute message.
116 117 118 |
# File 'lib/barrister.rb', line 116 def @message end |