OxL Reference

enum IoErrorKind

Why a file or OS operation failed: NotFound, PermissionDenied, AlreadyExists, InvalidData or Other.

Example:

oxl✓ checked in CI
fn advice(k: IoErrorKind) -> str {
  match k {
    .NotFound => "create it first"
    .PermissionDenied => "check the permissions"
    .AlreadyExists => "pick another name"
    .InvalidData => "the content is damaged"
    .Other => "see the message"
  }
}

fn main() io {
  print(advice(IoErrorKind.NotFound))
}
Output
create it first
pub(api) enum IoErrorKind

Since. 1.0.0-beta

Variants

NotFound

The path does not exist.

PermissionDenied

The process may not do it.

AlreadyExists

The path exists already.

InvalidData

The content is damaged or not valid for the operation.

Other

Any other failure.

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

See also