Exception: Common::Exceptions::Unauthorized
- Defined in:
- lib/common/exceptions/unauthorized.rb
Overview
Unauthorized - We may eventually want different variations on this with distinct MinorCodes
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(options = {}) ⇒ Unauthorized
constructor
A new instance of Unauthorized.
Methods inherited from BaseError
#i18n_data, #i18n_field, #i18n_interpolated, #i18n_key, #log_to_sentry?, #message, #sentry_type, #status_code
Constructor Details
#initialize(options = {}) ⇒ Unauthorized
Returns a new instance of Unauthorized.
10 11 12 13 14 |
# File 'lib/common/exceptions/unauthorized.rb', line 10 def initialize( = {}) @detail = [:detail] @source = [:source] @errors = [:errors] end |
Instance Method Details
#errors ⇒ Object
16 17 18 19 20 |
# File 'lib/common/exceptions/unauthorized.rb', line 16 def errors return @errors if @errors.present? Array(SerializableError.new(i18n_data.merge(detail: @detail, source: @source))) end |