Exception: Zotero::RateLimitError

Inherits:
Error
  • Object
show all
Defined in:
lib/zotero/error.rb

Overview

Raised when the API rate limit is exceeded

Instance Attribute Summary collapse

Instance Method Summary collapse

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(message, retry_after: nil, backoff: nil)
  super(message)
  @retry_after = retry_after
  @backoff = backoff
end

Instance Attribute Details

#backoffObject (readonly)

Returns the value of attribute backoff.



9
10
11
# File 'lib/zotero/error.rb', line 9

def backoff
  @backoff
end

#retry_afterObject (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_timeObject



17
18
19
# File 'lib/zotero/error.rb', line 17

def wait_time
  @retry_after || @backoff || 1
end