Exception: Api2Convert::RateLimitError

Inherits:
ApiError
  • Object
show all
Defined in:
lib/api2convert/errors.rb

Overview

Too many requests (HTTP 429), raised only once auto-retries are exhausted.

Instance Attribute Summary collapse

Attributes inherited from ApiError

#body, #request_id, #status_code

Instance Method Summary collapse

Constructor Details

#initialize(message, status_code: 429, request_id: nil, body: nil, retry_after: nil) ⇒ RateLimitError

Returns a new instance of RateLimitError.



54
55
56
57
# File 'lib/api2convert/errors.rb', line 54

def initialize(message, status_code: 429, request_id: nil, body: nil, retry_after: nil)
  super(message, status_code: status_code, request_id: request_id, body: body)
  @retry_after = retry_after
end

Instance Attribute Details

#retry_afterInteger? (readonly)

Returns seconds to wait before retrying, parsed from the Retry-After header (raw, uncapped).

Returns:

  • (Integer, nil)

    seconds to wait before retrying, parsed from the Retry-After header (raw, uncapped).



52
53
54
# File 'lib/api2convert/errors.rb', line 52

def retry_after
  @retry_after
end