OxL Reference

type NetError

The errors every rpc, actor message and cluster call can return in addition to its own: Timeout, Unavailable, Cancelled, AccessDenied and ProtocolError (§6.5).

Example:

oxl✓ checked in CI
fn describe(e: NetError) -> str {
  match e {
    Timeout _ => "too slow"
    Unavailable _ => "unreachable"
    Cancelled _ => "cancelled"
    AccessDenied _ => "not allowed"
    ProtocolError p => "protocol: {p.msg}"
  }
}

fn main() io {
  print(describe(Timeout{}))
}
Output
too slow
pub(api) type NetError = Timeout | Unavailable | Cancelled | AccessDenied | ProtocolError

Since. 1.0.0-beta

Defined in: std/core/types.oxl:1397

See also