OxL Reference

enum KvErrorKind

Why a store operation failed.

Example:

oxl✓ checked in CI
use std.kv { KvErrorKind }

fn advice(k: KvErrorKind) -> str {
  match k {
    .Conflict => "retry the transaction"
    .CrossShardTx => "keep the keys on one shard"
    .Lagged => "scan again and re-open the watch"
    .Other => "give up"
  }
}

fn main() io {
  print(advice(KvErrorKind.Conflict))
}
Output
retry the transaction
pub(api) enum KvErrorKind

Since. 1.0.0-beta

Variants

Conflict

A compare-and-set or a transaction validation failed: the data changed (the transaction was retried and kept failing).

CrossShardTx

The keys of a batch or transaction live on different shards.

Lagged

A watch fell behind the retained events; scan again and re-open the watch.

Other

Any other failure.

Defined in: std/kv/kv.oxl:87

See also