Exception: Common::Exceptions::TokenValidationError
- Inherits:
-
BaseError
- Object
- StandardError
- BaseError
- Common::Exceptions::TokenValidationError
- Defined in:
- lib/common/exceptions/token_validation_error.rb
Overview
Validation Error - an ActiveModel having validation errors, can be sent to this exception
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(options = {}) ⇒ TokenValidationError
constructor
A new instance of TokenValidationError.
Methods inherited from BaseError
#i18n_data, #i18n_field, #i18n_interpolated, #i18n_key, #log_to_sentry?, #message, #sentry_type, #status_code
Constructor Details
#initialize(options = {}) ⇒ TokenValidationError
Returns a new instance of TokenValidationError.
12 13 14 15 16 17 |
# File 'lib/common/exceptions/token_validation_error.rb', line 12 def initialize( = {}) @code = [:code] || 401 @detail = [:detail] @source = [:source] @status = [:status] || 401 end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
10 11 12 |
# File 'lib/common/exceptions/token_validation_error.rb', line 10 def code @code end |
#detail ⇒ Object (readonly)
Returns the value of attribute detail.
10 11 12 |
# File 'lib/common/exceptions/token_validation_error.rb', line 10 def detail @detail end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
10 11 12 |
# File 'lib/common/exceptions/token_validation_error.rb', line 10 def status @status end |
Instance Method Details
#errors ⇒ Object
19 20 21 |
# File 'lib/common/exceptions/token_validation_error.rb', line 19 def errors Array(SerializableError.new(i18n_data.merge(code: @code, detail: @detail, source: @source, status: @status))) end |