Class: Glia::Errors::UnknownError

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

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: nil, message: nil) ⇒ UnknownError

Returns a new instance of UnknownError.



127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/glia/errors/client_errors.rb', line 127

def initialize(field: nil, message: nil)
  super(
    type: UNKNOWN_ERROR,
    ref: create_ref(UNKNOWN_ERROR),
    message:
      if field
        message || "#{Naming.humanize(field)} validation failed with unknown error"
      else
        message || 'Failed with unknown error'
      end
  )
end