Exception: RLP::Error::ListDeserializationError

Inherits:
DeserializationError show all
Defined in:
lib/rlp/error.rb

Instance Attribute Summary collapse

Attributes inherited from DeserializationError

#serial

Instance Method Summary collapse

Constructor Details

#initialize(message: nil, serial: nil, element_exception: nil, index: nil) ⇒ ListDeserializationError

Returns a new instance of ListDeserializationError.


65
66
67
68
69
70
71
72
73
74
75
# File 'lib/rlp/error.rb', line 65

def initialize(message: nil, serial: nil, element_exception: nil, index: nil)
  if message.nil?
    raise ArgumentError, "index and element_exception must be present" if index.nil? || element_exception.nil?
    message = "Deserialization failed because of element at index #{index} ('#{element_exception}')"
  end

  super(message, serial)

  @index = index
  @element_exception = element_exception
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index


63
64
65
# File 'lib/rlp/error.rb', line 63

def index
  @index
end