Exception: Parse::Agent::RateLimiter::RateLimitExceeded
- Inherits:
-
StandardError
- Object
- StandardError
- Parse::Agent::RateLimiter::RateLimitExceeded
- Defined in:
- lib/parse/agent/rate_limiter.rb
Overview
Error raised when rate limit is exceeded
Instance Attribute Summary collapse
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#retry_after ⇒ Object
readonly
Returns the value of attribute retry_after.
-
#window ⇒ Object
readonly
Returns the value of attribute window.
Instance Method Summary collapse
-
#initialize(retry_after:, limit:, window:) ⇒ RateLimitExceeded
constructor
A new instance of RateLimitExceeded.
Constructor Details
#initialize(retry_after:, limit:, window:) ⇒ RateLimitExceeded
Returns a new instance of RateLimitExceeded.
32 33 34 35 36 37 |
# File 'lib/parse/agent/rate_limiter.rb', line 32 def initialize(retry_after:, limit:, window:) @retry_after = retry_after @limit = limit @window = window super("Rate limit exceeded (#{limit} requests per #{window}s). Retry after #{retry_after.round(1)}s") end |
Instance Attribute Details
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
30 31 32 |
# File 'lib/parse/agent/rate_limiter.rb', line 30 def limit @limit end |
#retry_after ⇒ Object (readonly)
Returns the value of attribute retry_after.
30 31 32 |
# File 'lib/parse/agent/rate_limiter.rb', line 30 def retry_after @retry_after end |
#window ⇒ Object (readonly)
Returns the value of attribute window.
30 31 32 |
# File 'lib/parse/agent/rate_limiter.rb', line 30 def window @window end |