Exception: JsonapiErrorsHandler::Errors::NotFound

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

Overview

Handles serialization of NotFound HTTP error (404 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) ⇒ NotFound

Returns a new instance of NotFound.



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

def initialize(message: nil)
  super(
    title: 'Record not Found',
    status: 404,
    detail: message || 'We could not find the object you were looking for.',
    source: { pointer: '/request/url/:id' }
  )
end