Exception: Zotero::RateLimitError
- Defined in:
- lib/zotero/error.rb
Overview
Raised when the API rate limit is exceeded
Instance Attribute Summary collapse
-
#backoff ⇒ Object
readonly
Returns the value of attribute backoff.
-
#retry_after ⇒ Object
readonly
Returns the value of attribute retry_after.
Instance Method Summary collapse
-
#initialize(message, retry_after: nil, backoff: nil) ⇒ RateLimitError
constructor
A new instance of RateLimitError.
- #wait_time ⇒ Object
Constructor Details
#initialize(message, retry_after: nil, backoff: nil) ⇒ RateLimitError
Returns a new instance of RateLimitError.
11 12 13 14 15 |
# File 'lib/zotero/error.rb', line 11 def initialize(, retry_after: nil, backoff: nil) super() @retry_after = retry_after @backoff = backoff end |
Instance Attribute Details
#backoff ⇒ Object (readonly)
Returns the value of attribute backoff.
9 10 11 |
# File 'lib/zotero/error.rb', line 9 def backoff @backoff end |
#retry_after ⇒ Object (readonly)
Returns the value of attribute retry_after.
9 10 11 |
# File 'lib/zotero/error.rb', line 9 def retry_after @retry_after end |
Instance Method Details
#wait_time ⇒ Object
17 18 19 |
# File 'lib/zotero/error.rb', line 17 def wait_time @retry_after || @backoff || 1 end |