Exception: JsonapiErrorsHandler::Errors::Forbidden

Inherits:
StandardError
  • Object
show all
Defined in:
lib/jsonapi_errors_handler/errors/forbidden.rb

Overview

Handles serialization of forbidden HTTP error (403 status code)

Instance Attribute Summary

Attributes inherited from StandardError

#detail, #source, #status, #title

Instance Method Summary collapse

Methods inherited from StandardError

#serializable_hash, #to_h, #to_s

Constructor Details

#initialize(message: nil) ⇒ Forbidden

Returns a new instance of Forbidden.



8
9
10
11
12
13
14
15
# File 'lib/jsonapi_errors_handler/errors/forbidden.rb', line 8

def initialize(message: nil)
  super(
    title: 'Forbidden request',
    status: 403,
    detail: message || 'You have no rights to access this resource',
    source: { pointer: '/request/headers/authorization' }
  )
end