Exception: Attributor::DeserializationError

Inherits:
LoadError show all
Defined in:
lib/attributor/exceptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(context:, from:, encoding:, value: nil) ⇒ DeserializationError

Returns a new instance of DeserializationError


24
25
26
27
28
# File 'lib/attributor/exceptions.rb', line 24

def initialize( context: , from:, encoding: , value: nil)
  msg = "Error deserializing a #{from} using #{encoding} while loading #{Attributor.humanize_context(context)}."
  msg += " Received value #{Attributor.errorize_value(value)}" if value
  super msg
end