Exception: RunApi::Core::RateLimitError
- 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
-
#retry_after ⇒ Numeric?
readonly
Suggested retry delay in seconds from Retry-After header.
Attributes inherited from Error
#details, #request_id, #response_headers, #status
Instance Method Summary collapse
-
#initialize(message = "Too many requests", retry_after: nil, **kwargs) ⇒ RateLimitError
constructor
A new instance of RateLimitError.
Methods inherited from Error
from_response, #response_header, #runapi_task_id, #to_h
Constructor Details
#initialize(message = "Too many requests", retry_after: nil, **kwargs) ⇒ RateLimitError
Returns a new instance of RateLimitError.
186 187 188 189 |
# File 'lib/runapi/core/errors.rb', line 186 def initialize( = "Too many requests", retry_after: nil, **kwargs) super(, status: 429, **kwargs) @retry_after = retry_after end |
Instance Attribute Details
#retry_after ⇒ Numeric? (readonly)
Returns Suggested retry delay in seconds from Retry-After header.
184 185 186 |
# File 'lib/runapi/core/errors.rb', line 184 def retry_after @retry_after end |