Exception: JsonRpcClient::Error
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- JsonRpcClient::Error
- Defined in:
- lib/json-rpc-client.rb
Overview
This class corresponds to the JSON-RPC error object gotten from the server. A “faked” instance of this will be thrown for communication errors as well.
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(msg, code, data) ⇒ Error
constructor
A new instance of Error.
-
#inspect ⇒ String
Returns the contents of the current error object as a string.
Constructor Details
#initialize(msg, code, data) ⇒ Error
Returns a new instance of Error.
182 183 184 185 186 |
# File 'lib/json-rpc-client.rb', line 182 def initialize(msg, code, data) super(msg) @code = code @data = data end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
181 182 183 |
# File 'lib/json-rpc-client.rb', line 181 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
181 182 183 |
# File 'lib/json-rpc-client.rb', line 181 def data @data end |
Instance Method Details
#inspect ⇒ String
Returns the contents of the current error object as a string.
192 193 194 |
# File 'lib/json-rpc-client.rb', line 192 def inspect %|#{self.class}: #{self.}, code: #{@code.inspect}, data: #{@data.inspect}| end |