Exception: VIC::IDCardAttributeError

Inherits:
Common::Exceptions::BaseError show all
Defined in:
lib/vic/id_card_attribute_error.rb

Constant Summary collapse

VIC002 =
{ status: 403, code: 'VIC002', detail: 'No EDIPI or not found in VA Profile' }.freeze
VIC010 =
{ status: 403, code: 'VIC010', detail: 'Could not verify Veteran status' }.freeze
NOT_ELIGIBLE =
{
  status: 403,
  detail: 'Not eligible for a Veteran ID Card'
}.freeze

Instance Method Summary collapse

Methods inherited from Common::Exceptions::BaseError

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

Constructor Details

#initialize(options = {}) ⇒ IDCardAttributeError

Returns a new instance of IDCardAttributeError.



14
15
16
17
18
# File 'lib/vic/id_card_attribute_error.rb', line 14

def initialize(options = {})
  @detail = options[:detail] || i18n_field(:detail, {})
  @code = options[:code] || i18n_field(:code, {})
  @status = options[:status] || i18n_field(:status, {})
end

Instance Method Details

#errorsObject



20
21
22
# File 'lib/vic/id_card_attribute_error.rb', line 20

def errors
  Array(Common::Exceptions::SerializableError.new(i18n_data.merge(detail: @detail, code: @code, status: @status)))
end