zig icon indicating copy to clipboard operation
zig copied to clipboard

Handle all errors on std.net.Ipv4address.resolveIP

Open haesbaert opened this issue 2 years ago • 0 comments

The following test fails since NonCanonical is not handled

test "foo" {
    std.net.Ip4Address.resolveIp("1.1.1.1", 0) catch unreachable;
}

/usr/lib/zig/std/net.zig:240:60: error: switch must handle all possibilities
        if (parse(name, port)) |ip4| return ip4 else |err| switch (err) {
                                                           ^~~~~~
/usr/lib/zig/std/net.zig:240:60: note: unhandled error value: 'error.NonCanonical' referenced by:
    test.foo: src/dhcp.zig:383:23

haesbaert avatar Jun 16 '23 09:06 haesbaert