Exception: Ksef::RateLimitedError

Inherits:
ApiError show all
Defined in:
lib/ksef/errors.rb

Overview

HTTP 429. Retryable, but only for idempotent requests (DESIGN.md §6.7).

Instance Attribute Summary collapse

Attributes inherited from Error

#problem

Instance Method Summary collapse

Methods inherited from ApiError

#code, #details, #raw, #status, #trace_id

Constructor Details

#initialize(message = nil, problem: nil, retry_after: nil) ⇒ RateLimitedError

Returns a new instance of RateLimitedError.



110
111
112
113
# File 'lib/ksef/errors.rb', line 110

def initialize(message = nil, problem: nil, retry_after: nil)
  @retry_after = retry_after
  super(message, problem: problem)
end

Instance Attribute Details

#retry_after ⇒ Integer? (readonly)

Returns seconds to wait, from the Retry-After header. Authoritative — the block period is dynamic and lengthens with repeat offences (docs/REFERENCE.md §6). Never work around a 429 by rotating IPs.

Returns:

  • (Integer, nil) —

    seconds to wait, from the Retry-After header. Authoritative — the block period is dynamic and lengthens with repeat offences (docs/REFERENCE.md §6). Never work around a 429 by rotating IPs.



108
109
110
# File 'lib/ksef/errors.rb', line 108

def retry_after
  @retry_after
end