Exception: RLP::Error::ObjectDeserializationError
- Inherits:
-
DeserializationError
- Object
- Exception
- 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.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/rlp/error.rb', line 124 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.
116 117 118 |
# File 'lib/rlp/error.rb', line 116 def field @field end |
#list_exception ⇒ Object (readonly)
Returns the value of attribute list_exception.
116 117 118 |
# File 'lib/rlp/error.rb', line 116 def list_exception @list_exception end |
#sedes ⇒ Object (readonly)
Returns the value of attribute sedes.
116 117 118 |
# File 'lib/rlp/error.rb', line 116 def sedes @sedes end |