Exception: XeroKiwi::Throttle::DailyLimitExhausted

Inherits:
Error
  • Object
show all
Defined in:
lib/xero_kiwi/throttle.rb

Overview

Raised immediately (no sleep) when the per-day bucket is exhausted. The wait until reset is typically measured in hours, so blocking the caller is the wrong move — re-enqueue the job at ‘retry_after` instead. Shape mirrors RateLimitError so existing Xero rate-limit handling applies.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(retry_after:) ⇒ DailyLimitExhausted

Returns a new instance of DailyLimitExhausted.



25
26
27
28
# File 'lib/xero_kiwi/throttle.rb', line 25

def initialize(retry_after:)
  @retry_after = retry_after
  super("Xero daily rate limit exhausted; retry in #{retry_after.round}s")
end

Instance Attribute Details

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



23
24
25
# File 'lib/xero_kiwi/throttle.rb', line 23

def retry_after
  @retry_after
end