Exception: Common::Exceptions::InvalidField

Inherits:
BaseError
  • Object
show all
Defined in:
lib/common/exceptions/invalid_field.rb

Overview

InvalidField - field is invalid

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseError

#i18n_data, #i18n_field, #i18n_interpolated, #i18n_key, #log_to_sentry?, #message, #sentry_type, #status_code

Constructor Details

#initialize(field, type) ⇒ InvalidField

Returns a new instance of InvalidField.



12
13
14
15
# File 'lib/common/exceptions/invalid_field.rb', line 12

def initialize(field, type)
  @field = field
  @type = type
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



10
11
12
# File 'lib/common/exceptions/invalid_field.rb', line 10

def field
  @field
end

#typeObject (readonly)

Returns the value of attribute type.



10
11
12
# File 'lib/common/exceptions/invalid_field.rb', line 10

def type
  @type
end

Instance Method Details

#errorsObject



17
18
19
# File 'lib/common/exceptions/invalid_field.rb', line 17

def errors
  Array(SerializableError.new(i18n_interpolated(detail: { field: @field, type: @type })))
end