Exception: HCl::HarvestMiddleware::ThrottleFailure
- Inherits:
-
StandardError
- Object
- StandardError
- HCl::HarvestMiddleware::ThrottleFailure
- Defined in:
- lib/hcl/harvest_middleware.rb
Instance Attribute Summary collapse
-
#retry_after ⇒ Object
readonly
Returns the value of attribute retry_after.
Instance Method Summary collapse
-
#initialize(env) ⇒ ThrottleFailure
constructor
A new instance of ThrottleFailure.
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_after ⇒ Object (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 |