common_rates.errors
Why a limiter did not admit a call: the one exception family.
Admission has two outcomes, granted or refused, and the granted one is a wait. So refusal raises, which is exactly what an HTTP client’s admission hook expects: wait, or reject by raising.
Classes
LimiterError
Bases: RuntimeError
A limiter could not admit a call.
Refused
Bases: LimiterError
The wait a quota demanded exceeds what the caller allows.
__init__
def __init__(scope: Scope, quota: str | None, wait: float, max_wait: float) -> NoneFields and properties declared here; inherited members belong to the bases above.
max_wait
max_wait = max_waitquota
quota = quotascope
scope = scopewait
wait = waitUnavailable
Bases: LimiterError
The shared backend could not be reached, and the policy refuses without it.
Undeclared
Bases: LimiterError
No quotas are declared for the scope; a limiter never guesses a vendor’s limits.
__init__
def __init__(scope: Scope) -> NoneFields and properties declared here; inherited members belong to the bases above.
scope
scope = scope