Exception: Basecamp::ForbiddenError

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

Overview

Raised when access is denied (403).

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = "Access denied", hint: nil) ⇒ ForbiddenError

Returns a new instance of ForbiddenError.



6
7
8
9
10
11
12
13
# File 'lib/basecamp/forbidden_error.rb', line 6

def initialize(message = "Access denied", hint: nil)
  super(
    code: ErrorCode::FORBIDDEN,
    message: message,
    hint: hint || "You do not have permission to access this resource",
    http_status: 403
  )
end

Class Method Details

.insufficient_scopeObject

Creates a forbidden error due to insufficient OAuth scope.



16
17
18
# File 'lib/basecamp/forbidden_error.rb', line 16

def self.insufficient_scope
  new("Access denied: insufficient scope", hint: "Re-authenticate with full scope")
end