Exception: RLP::Error::ListSerializationError

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

Instance Attribute Summary collapse

Attributes inherited from SerializationError

#obj

Instance Method Summary collapse

Constructor Details

#initialize(message: nil, obj: nil, element_exception: nil, index: nil) ⇒ ListSerializationError

Returns a new instance of ListSerializationError.


49
50
51
52
53
54
55
56
57
58
59
# File 'lib/rlp/error.rb', line 49

def initialize(message: nil, obj: 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 = "Serialization failed because of element at index #{index} ('#{element_exception}')"
  end

  super(message, obj)

  @index = index
  @element_exception = element_exception
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index


47
48
49
# File 'lib/rlp/error.rb', line 47

def index
  @index
end