Exception: Common::Exceptions::ParametersMissing

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

Overview

Parameter Missing - required parameter was not provided

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(params) ⇒ ParametersMissing

Returns a new instance of ParametersMissing.



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

def initialize(params)
  @params = params
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



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

def params
  @params
end

Instance Method Details

#errorsObject



16
17
18
19
20
21
# File 'lib/common/exceptions/parameters_missing.rb', line 16

def errors
  @params.map do |param|
    detail = i18n_field(:detail, param:)
    SerializableError.new(i18n_data.merge(detail:))
  end
end