Exception: MisarReach::RateLimitError
- Defined in:
- lib/misar_reach/errors.rb
Overview
429 — rate limited. retry_after carries the seconds to wait when provided.
Instance Attribute Summary collapse
-
#balance ⇒ Object
readonly
Returns the value of attribute balance.
-
#free_remaining ⇒ Object
readonly
Returns the value of attribute free_remaining.
Attributes inherited from ApiError
#body, #code, #retry_after, #status
Instance Method Summary collapse
-
#initialize(message = "Too many requests", retry_after: nil, balance: nil, free_remaining: nil, **opts) ⇒ RateLimitError
constructor
A new instance of RateLimitError.
Constructor Details
#initialize(message = "Too many requests", retry_after: nil, balance: nil, free_remaining: nil, **opts) ⇒ RateLimitError
Returns a new instance of RateLimitError.
33 34 35 36 37 |
# File 'lib/misar_reach/errors.rb', line 33 def initialize( = "Too many requests", retry_after: nil, balance: nil, free_remaining: nil, **opts) @balance = balance @free_remaining = free_remaining super(429, , code: opts[:code] || "rate_limit", retry_after: retry_after, body: opts[:body]) end |
Instance Attribute Details
#balance ⇒ Object (readonly)
Returns the value of attribute balance.
31 32 33 |
# File 'lib/misar_reach/errors.rb', line 31 def balance @balance end |
#free_remaining ⇒ Object (readonly)
Returns the value of attribute free_remaining.
31 32 33 |
# File 'lib/misar_reach/errors.rb', line 31 def free_remaining @free_remaining end |