Exception: Basecamp::NotFoundError

Inherits:
Error
  • Object
show all
Defined in:
lib/basecamp/not_found_error.rb

Overview

Raised when a resource is not found (404).

Instance Method Summary collapse

Constructor Details

#initialize(resource = nil, identifier = nil, message: nil, hint: nil) ⇒ NotFoundError

Returns a new instance of NotFoundError.



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/basecamp/not_found_error.rb', line 6

def initialize(resource = nil, identifier = nil, message: nil, hint: nil)
  message ||= if resource
    "#{resource} not found: #{identifier}"
  else
    "Not found"
  end
  super(
    code: ErrorCode::NOT_FOUND,
    message: message,
    hint: hint,
    http_status: 404
  )
end