OxL Reference

data TopicError

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

Example:

oxl✓ checked in 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" }))
}
Output
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

Since. 1.0.0-beta

Fields

pub(api) kind: TopicErrorKind

What the caller can do.

pub(api) msg: str

Detail text.

Defined in: std/core/topic.oxl:57

See also