OxL Справочник OxL
РусскийEnglish

data Unavailable

The callee cannot be reached or refuses work right now (refused, reset, no replica, overload). retryAfter is the hint of @ratelimit. One of the alternatives of NetError.

Example:

oxl✓ проверяется в CI
fn wait_hint(e: Unavailable) -> Duration => e.retryAfter ?? 1s

fn main() io {
  print("{wait_hint(Unavailable{ retryAfter: 5s }).seconds()} {wait_hint(Unavailable{}).seconds()}")
}
Вывод
5 1
@error pub(api) data Unavailable

С версии. 1.0.0-beta

Поля

pub(api) retryAfter: Duration? = none

Hint of @ratelimit (§10.2): how long to wait before the next attempt.

Определено в: std/core/types.oxl:1310

См. также