Exception: RLP::Error::ListSerializationError
- Inherits:
-
SerializationError
- Object
- StandardError
- RLPException
- SerializationError
- RLP::Error::ListSerializationError
- Defined in:
- lib/rlp/error.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
Attributes inherited from SerializationError
Instance Method Summary collapse
-
#initialize(message: nil, obj: nil, element_exception: nil, index: nil) ⇒ ListSerializationError
constructor
A new instance of ListSerializationError.
Constructor Details
#initialize(message: nil, obj: nil, element_exception: nil, index: nil) ⇒ ListSerializationError
Returns a new instance of ListSerializationError.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/rlp/error.rb', line 51 def initialize(message: nil, obj: nil, element_exception: nil, index: nil) if .nil? raise ArgumentError, "index and element_exception must be present" if index.nil? || element_exception.nil? = "Serialization failed because of element at index #{index} ('#{element_exception}')" end super(, obj) @index = index @element_exception = element_exception end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
49 50 51 |
# File 'lib/rlp/error.rb', line 49 def index @index end |