Sha256: d9fc7ccce909272e0010001ba263f2709a8250e7c5d4b934aebef19b8c715777
Contents?: true
Size: 1.26 KB
Versions: 14
Compression:
Stored size: 1.26 KB
Contents
module Attributor class AttributorException < ::StandardError end class LoadError < AttributorException end class IncompatibleTypeError < LoadError def initialize(type:, value_type: , context: ) super "Type #{type} cannot load values of type #{value_type} while loading #{Attributor.humanize_context(context)}." end end class CoercionError < LoadError def initialize( context: , from: , to:, value: nil) msg = "Error coercing from #{from} to #{to} while loading #{Attributor.humanize_context(context)}." msg += " Received value #{Attributor.errorize_value(value)}" if value super msg end end class DeserializationError < LoadError 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 end class DumpError < AttributorException def initialize( context: , name: , type: , original_exception: ) msg = "Error while dumping attribute #{name} of type #{type} for context #{Attributor.humanize_context(context)}." msg << " Reason: #{original_exception}" super msg end end end
Version data entries
14 entries across 14 versions & 1 rubygems