Exception: AmazonAds::ApiClient::ThrottledError

Inherits:
StandardError
  • Object
show all
Defined in:
app/services/amazon_ads/api_client.rb

Overview

Raised as soon as Amazon responds with a throttle. Callers treat this
differently from a generic failure: continuing to hammer a
throttled endpoint just burns the remaining quota and guarantees the
next request fails too, so the right response is to stop and come back
later. Nested here rather than under AmazonAds so Zeitwerk resolves it
from this file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, retry_after: nil) ⇒ ThrottledError

Returns a new instance of ThrottledError.

Parameters:

  • message (String, nil) (defaults to: nil)
  • retry_after (Integer, nil) (defaults to: nil)

    seconds from the Retry-After header



38
39
40
41
# File 'app/services/amazon_ads/api_client.rb', line 38

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

Instance Attribute Details

#retry_afterInteger? (readonly)

Returns seconds Amazon asked us to wait, when it said.

Returns:

  • (Integer, nil)

    seconds Amazon asked us to wait, when it said



34
35
36
# File 'app/services/amazon_ads/api_client.rb', line 34

def retry_after
  @retry_after
end