Class: Glia::Errors::InvalidTypeError

Inherits:
Error
  • Object
show all
Defined in:
lib/glia/errors/client_errors.rb

Defined Under Namespace

Classes: Types

Instance Attribute Summary

Attributes inherited from Error

#error_details, #message, #ref, #type

Instance Method Summary collapse

Methods inherited from Error

#to_h

Constructor Details

#initialize(field:, type:, message: nil) ⇒ InvalidTypeError

Returns a new instance of InvalidTypeError.



106
107
108
109
110
111
112
113
# File 'lib/glia/errors/client_errors.rb', line 106

def initialize(field:, type:, message: nil)
  super(
    type: INVALID_TYPE_ERROR,
    ref: create_ref(INVALID_TYPE_ERROR),
    message: message || "#{Naming.humanize(field)} must be of type #{type}",
    error_details: { type: type }
  )
end