Class: Hcp::TooManyRequests

Inherits:
Error
  • Object
show all
Defined in:
lib/hcp/errors/too_many_requests.rb

Overview

Raised where Housecall Pro refuses a request for rate.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, reset_at) ⇒ TooManyRequests

Returns a new instance of TooManyRequests.

Parameters:

  • message (String)

    what Housecall Pro said.

  • reset_at (Time, nil)

    when it will answer again.



6
7
8
9
# File 'lib/hcp/errors/too_many_requests.rb', line 6

def initialize(message, reset_at)
  super message
  @reset_at = reset_at
end

Instance Attribute Details

#reset_atTime? (readonly)

Nothing here sleeps: a caller with a queue can bring the whole job back, which is worth more than a worker asleep holding a connection open.

Returns:

  • (Time, nil)

    when the limit lifts, where Housecall Pro said.



14
15
16
# File 'lib/hcp/errors/too_many_requests.rb', line 14

def reset_at
  @reset_at
end