Exception: Walinko::RateLimitError

Inherits:
ApiError show all
Defined in:
lib/walinko/errors.rb

Overview

429 — sliding-window rate limit (default 30 req/min/key) exceeded. ‘#retry_after` is the recommended sleep in seconds (parsed from `Retry-After` header).

Instance Attribute Summary collapse

Attributes inherited from ApiError

#body, #details, #error_code, #http_status, #request_id

Instance Method Summary collapse

Methods inherited from ApiError

#inspect

Constructor Details

#initialize(message, retry_after: nil, **kwargs) ⇒ RateLimitError

Returns a new instance of RateLimitError.



98
99
100
101
# File 'lib/walinko/errors.rb', line 98

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

Instance Attribute Details

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



96
97
98
# File 'lib/walinko/errors.rb', line 96

def retry_after
  @retry_after
end