aboutsummaryrefslogtreecommitdiff
path: root/doc/langref/runtime_unwrap_error.zig
blob: ad84f819108e942acc420356bbfeda9289736486 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
const std = @import("std");

pub fn main() void {
    const number = getNumberOrFail() catch unreachable;
    std.debug.print("value: {}\n", .{number});
}

fn getNumberOrFail() !i32 {
    return error.UnableToReturnNumber;
}

// exe=fail