Exception: Common::Exceptions::Forbidden

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

Overview

Forbidden - We may eventually want different variations on this with distinct MinorCodes

Direct Known Subclasses

UnexpectedForbidden

Instance Method Summary collapse

Methods inherited from BaseError

#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(options = {})
  @detail = options[:detail]
  @source = options[:source]
  @errors = options[:errors]
end

Instance Method Details

#errorsObject



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