Exception: TestingBot::RateLimitError

Inherits:
ClientError show all
Defined in:
lib/testingbot/errors.rb

Overview

429 — the account hit the API rate limit. retry_after exposes the server-provided Retry-After value (seconds) when present.

Instance Attribute Summary collapse

Attributes inherited from Error

#body, #http_status

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, http_status: nil, body: nil, retry_after: nil) ⇒ RateLimitError

Returns a new instance of RateLimitError.



40
41
42
43
# File 'lib/testingbot/errors.rb', line 40

def initialize(message = nil, http_status: nil, body: nil, retry_after: nil)
  @retry_after = retry_after
  super(message, http_status: http_status, body: body)
end

Instance Attribute Details

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



38
39
40
# File 'lib/testingbot/errors.rb', line 38

def retry_after
  @retry_after
end