Exception: RunApi::Core::RateLimitError

Inherits:
Error
  • Object
show all
Defined in:
lib/runapi/core/errors.rb

Overview

Raised when rate limit is exceeded (HTTP 429). Includes retry-after delay.

Constant Summary

Constants inherited from Error

Error::DEFAULT_MESSAGES, Error::STATUS_MAP

Instance Attribute Summary collapse

Attributes inherited from Error

#details, #request_id, #status

Instance Method Summary collapse

Methods inherited from Error

from_response, #to_h

Constructor Details

#initialize(message = "Too many requests", retry_after: nil, **kwargs) ⇒ RateLimitError

Returns a new instance of RateLimitError.



170
171
172
173
# File 'lib/runapi/core/errors.rb', line 170

def initialize(message = "Too many requests", retry_after: nil, **kwargs)
  super(message, status: 429, **kwargs)
  @retry_after = retry_after
end

Instance Attribute Details

#retry_afterNumeric? (readonly)

Returns Suggested retry delay in seconds from Retry-After header.

Returns:

  • (Numeric, nil)

    Suggested retry delay in seconds from Retry-After header.



168
169
170
# File 'lib/runapi/core/errors.rb', line 168

def retry_after
  @retry_after
end