Exception: Eth::Client::RpcError

Inherits:
IOError
  • Object
show all
Defined in:
lib/eth/client.rb

Overview

Raised when an RPC call returns an error. Carries the error code and the optional hex-encoded error data to support custom error decoding.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Constructor for the Eth::Client::RpcError class.

Parameters:

  • message (String)

    the error message returned by the RPC.

  • data (String) (defaults to: nil)

    optional hex encoded error data.

  • code (String) (defaults to: nil)

    optional error code returned by the RPC.



54
55
56
57
58
# File 'lib/eth/client.rb', line 54

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



47
48
49
# File 'lib/eth/client.rb', line 47

def code
  @code
end

#dataObject (readonly)

Returns the value of attribute data.



46
47
48
# File 'lib/eth/client.rb', line 46

def data
  @data
end