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

data TopicError

The error of a topic operation: kind says what the caller can do (retry, give up), msg is the detail.

Example:

oxl✓ проверяется в CI
fn handle(e: TopicError) -> str {
  match e.kind {
    .Unavailable => "retry later: {e.msg}"
    _ => "give up: {e.msg}"
  }
}

fn main() io {
  print(handle(TopicError{ kind: TopicErrorKind.Unavailable, msg: "no leader" }))
}
Вывод
retry later: no leader

The error of a topic operation: kind says what the caller can do (retry, give up), msg is the detail.

@error pub(api) data TopicError

С версии. 1.0.0-beta

Поля

pub(api) kind: TopicErrorKind

What the caller can do.

pub(api) msg: str

Detail text.

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

См. также