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
1 files changed, 1 insertions(+), 0 deletions(-)
lib
std
lib/std/net.zig+1
| ... | ... | @@ -264,6 +264,7 @@ pub const Ip4Address = extern struct { |
| 264 | 264 | error.InvalidEnd, |
| 265 | 265 | error.InvalidCharacter, |
| 266 | 266 | error.Incomplete, |
| 267 | error.NonCanonical, |
| 267 | 268 | => {}, |
| 268 | 269 | } |
| 269 | 270 | return error.InvalidIPAddressFormat; |