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.



77
78
79
80
# File 'lib/ksef/errors.rb', line 77

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

Instance Attribute Details

#retry_afterInteger? (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.



75
76
77
# File 'lib/ksef/errors.rb', line 75

def retry_after
  @retry_after
end