Exception: Basecamp::RateLimitError

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

Overview

Raised when rate limited (429).

Instance Method Summary collapse

Constructor Details

#initialize(retry_after: nil, cause: nil) ⇒ RateLimitError

Returns a new instance of RateLimitError.



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

def initialize(retry_after: nil, cause: nil)
  hint = retry_after ? "Try again in #{retry_after} seconds" : "Please slow down requests"
  super(
    code: ErrorCode::RATE_LIMIT,
    message: "Rate limit exceeded",
    hint: hint,
    http_status: 429,
    retryable: true,
    retry_after: retry_after,
    cause: cause
  )
end