Skip to content
Xen / docs

Search documentation

English · v0.1.0-demo.2

Type to search the documentation.

    한국어
    Xen / reference v0.1.0-demo.2

    Errors and termination

    A possibly absent value is Option.Some(value) or Option.None. A fallible operation returns Result.Ok(value) or Result.Err(error). Handle each case with match. ? extracts success or propagates an error to the caller; the function needs a compatible Result return type.

    panic(message) terminates the program. Panic and runtime errors skip normal block cleanup. Handle expected file and input errors using Result. Exceptions are unavailable.

    CLI exit statusMeaning
    0Success
    1Code, runtime, or test error, or no matching tests
    2Invalid command usage

    run propagates the program’s exit status.

    Learn more: Missing values and errors · Command-line tools