Class: Glia::Errors::InvalidFormatError
- Defined in:
- lib/glia/errors/client_errors.rb
Defined Under Namespace
Classes: Formats
Instance Attribute Summary
Attributes inherited from Error
#error_details, #message, #ref, #type
Instance Method Summary collapse
-
#initialize(field:, format: nil, message: nil) ⇒ InvalidFormatError
constructor
A new instance of InvalidFormatError.
Methods inherited from Error
Constructor Details
#initialize(field:, format: nil, message: nil) ⇒ InvalidFormatError
Returns a new instance of InvalidFormatError.
63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/glia/errors/client_errors.rb', line 63 def initialize(field:, format: nil, message: nil) = if format "has invalid format, required format is #{humanize_format(format)}" else 'has invalid format' end super( type: INVALID_FORMAT_ERROR, ref: create_ref(INVALID_FORMAT_ERROR), message: || "#{Naming.humanize(field)} #{}" ) end |