OxL Reference

data CallDetails

A typed error detail of a failed call: the name of the error type and its encoded value.

Example:

oxl✓ checked in CI
use std.rpc { callDetails }

@error data Missing { what: str }

service S {
  @public rpc find() -> i32 | Missing
}

impl S {
  rpc find() { fail Missing{ what: "x" } }
}

fn main() io, net {
  let d = callDetails(S, "find", b"")
  print(d.type)
}
Output
Missing
pub(api) data CallDetails

Since. 1.0.0-beta

Fields

pub(api) type: str

Name of the error type; empty when there is none.

pub(api) value: bytes

The encoded error value.

Defined in: std/rpc/rpc.oxl:173

See also