zig/doc/langref/runtime_unwrap_error.zig

13 lines
238 B
Zig
Raw Normal View History

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