# Handle all errors on std.net.Ipv4address.resolveIP · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/bf7ebfa67af78da3ad40869cc61aecb594f9fc74)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: bf7ebfa67af78da3ad40869cc61aecb594f9fc74

Requested commit: bf7ebfa67af78da3ad40869cc61aecb594f9fc74

Commit: bf7ebfa67af78da3ad40869cc61aecb594f9fc74

Tree: d03e684951570de0b03428a4c89229e463701039

Author: Christiano Haesbaert

Committer: Veikka Tuominen

## Message

```
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

```

## Parents

- [2e7d28dd0d27d94945ac5f131d7f7b4e03bc0024](https://git.cafe/gitcafe/zig/commit/2e7d28dd0d27d94945ac5f131d7f7b4e03bc0024?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/bf7ebfa67af78da3ad40869cc61aecb594f9fc74?format=markdown)
