Exception: Common::Exceptions::OpenIdServiceError

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

Overview

Validation Error - an ActiveModel having validation errors, can be sent to this exception

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(options = {}) ⇒ OpenIdServiceError

Returns a new instance of OpenIdServiceError.



12
13
14
15
16
17
# File 'lib/common/exceptions/open_id_service_error.rb', line 12

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#detailObject (readonly)

Returns the value of attribute detail.



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

def detail
  @detail
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

Instance Method Details

#errorsObject



19
20
21
# File 'lib/common/exceptions/open_id_service_error.rb', line 19

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