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

enum TopicErrorKind

Why a topic operation failed.

Example:

oxl✓ проверяется в CI
fn describe(k: TopicErrorKind) -> str {
  match k {
    .Unavailable => "nothing was stored, retry"
    .Unknown => "may or may not be stored"
    .AccessDenied => "policy refused"
    .Decode => "element has a different type"
    .Other => "other"
  }
}

fn main() io {
  print(describe(TopicErrorKind.Unknown))
}
Вывод
may or may not be stored
pub(api) enum TopicErrorKind

С версии. 1.0.0-beta

Варианты

Unavailable

The store was not reachable or has no leader right now (nothing was stored).

Unknown

The outcome is unknown: the element may or may not have been stored (publish again to be sure of at-least-once).

AccessDenied

The policy of the topic refuses the caller.

Decode

A stored element does not decode as the topic's type.

Other

Any other failure.

Определено в: std/core/topic.oxl:25

См. также