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