Exception: Prop::RateLimitExceededError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/prop.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#handleObject

Returns the value of attribute handle.



11
12
13
# File 'lib/prop.rb', line 11

def handle
  @handle
end

#retry_afterObject

Returns the value of attribute retry_after.



11
12
13
# File 'lib/prop.rb', line 11

def retry_after
  @retry_after
end

Class Method Details

.create(handle, key, threshold) ⇒ Object



13
14
15
16
17
18
# File 'lib/prop.rb', line 13

def self.create(handle, key, threshold)
  error = new("#{handle} threshold of #{threshold} exceeded for key '#{key}'")
  error.handle      = handle
  error.retry_after = threshold - Time.now.to_i % threshold if threshold > 0
  raise error
end