Exception: ReactorSDK::RateLimitError

Inherits:
Error
  • Object
show all
Defined in:
lib/reactor_sdk/error.rb

Overview

Raised when the rate limit is hit after all retries are exhausted (HTTP 429). The retry_after value is taken from Adobe’s Retry-After response header.

Instance Attribute Summary collapse

Attributes inherited from Error

#cause, #status

Instance Method Summary collapse

Constructor Details

#initialize(message, retry_after: nil) ⇒ RateLimitError

Returns a new instance of RateLimitError.

Parameters:

  • message (String)

    Error description

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

    Seconds until rate limit resets

  • opts (Hash)

    Passed through to ReactorSDK::Error



94
95
96
97
# File 'lib/reactor_sdk/error.rb', line 94

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

Instance Attribute Details

#retry_afterInteger? (readonly)

Returns Seconds to wait before the next request.

Returns:

  • (Integer, nil)

    Seconds to wait before the next request



87
88
89
# File 'lib/reactor_sdk/error.rb', line 87

def retry_after
  @retry_after
end