Exception: Whoosh::Errors::RateLimitExceeded

Inherits:
HttpError show all
Defined in:
lib/whoosh/errors.rb

Instance Attribute Summary collapse

Attributes inherited from HttpError

#error_type, #status

Instance Method Summary collapse

Constructor Details

#initialize(message = "Rate limit exceeded", retry_after: 60) ⇒ RateLimitExceeded

Returns a new instance of RateLimitExceeded.



55
56
57
58
# File 'lib/whoosh/errors.rb', line 55

def initialize(message = "Rate limit exceeded", retry_after: 60)
  @retry_after = retry_after
  super(message, status: 429, error_type: "rate_limited")
end

Instance Attribute Details

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



53
54
55
# File 'lib/whoosh/errors.rb', line 53

def retry_after
  @retry_after
end

Instance Method Details

#to_hObject



60
61
62
# File 'lib/whoosh/errors.rb', line 60

def to_h
  super.merge(retry_after: retry_after)
end