mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
Handle all errors on std.net.Ipv4address.resolveIP
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
This commit is contained in:
parent
2e7d28dd0d
commit
bf7ebfa67a
@ -264,6 +264,7 @@ pub const Ip4Address = extern struct {
|
||||
error.InvalidEnd,
|
||||
error.InvalidCharacter,
|
||||
error.Incomplete,
|
||||
error.NonCanonical,
|
||||
=> {},
|
||||
}
|
||||
return error.InvalidIPAddressFormat;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user