Exception: RLP::Error::ObjectDeserializationError
- Inherits:
-
DeserializationError
- Object
- StandardError
- RLPException
- DeserializationError
- RLP::Error::ObjectDeserializationError
- Defined in:
- lib/rlp/error.rb
Overview
Exception raised if deserialization by a Sedes::Serializable fails.
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#list_exception ⇒ Object
readonly
Returns the value of attribute list_exception.
-
#sedes ⇒ Object
readonly
Returns the value of attribute sedes.
Attributes inherited from DeserializationError
Instance Method Summary collapse
-
#initialize(message: nil, serial: nil, sedes: nil, list_exception: nil) ⇒ ObjectDeserializationError
constructor
A new instance of ObjectDeserializationError.
Constructor Details
#initialize(message: nil, serial: nil, sedes: nil, list_exception: nil) ⇒ ObjectDeserializationError
Returns a new instance of ObjectDeserializationError.
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/rlp/error.rb', line 126 def initialize(message: nil, serial: nil, sedes: nil, list_exception: nil) if .nil? raise ArgumentError, "list_exception must be present" if list_exception.nil? if list_exception.element_exception raise ArgumentError, "sedes must be present" if sedes.nil? field = sedes.serializable_fields.keys[list_exception.index] = "Deserialization failed because of field #{field} ('#{list_exception.element_exception}')" else field = nil = "Deserialization failed because of underlying list ('#{list_exception}')" end end super(, serial) @sedes = sedes @field = field @list_exception = list_exception end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
118 119 120 |
# File 'lib/rlp/error.rb', line 118 def field @field end |
#list_exception ⇒ Object (readonly)
Returns the value of attribute list_exception.
118 119 120 |
# File 'lib/rlp/error.rb', line 118 def list_exception @list_exception end |
#sedes ⇒ Object (readonly)
Returns the value of attribute sedes.
118 119 120 |
# File 'lib/rlp/error.rb', line 118 def sedes @sedes end |