Exception: HCl::HarvestMiddleware::ThrottleFailure

Inherits:
StandardError
  • Object
show all
Defined in:
lib/hcl/harvest_middleware.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ ThrottleFailure

Returns a new instance of ThrottleFailure.



53
54
55
56
# File 'lib/hcl/harvest_middleware.rb', line 53

def initialize env
  @retry_after = env[:response_headers]['retry-after'].to_i
  super "Too many requests! Try again in #{@retry_after} seconds."
end

Instance Attribute Details

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



52
53
54
# File 'lib/hcl/harvest_middleware.rb', line 52

def retry_after
  @retry_after
end