# Eliminate \`error.InvalidHandle\` from OpenError and RealPathError · gitcafe/zig

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

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

Visibility: public

Requested revision: ae7f3fc360ce2f72611b5ef6abc6f21d31f82870

Requested commit: ae7f3fc360ce2f72611b5ef6abc6f21d31f82870

Commit: ae7f3fc360ce2f72611b5ef6abc6f21d31f82870

Tree: 63f0dd22c004da965440985d22c08395f2eed32c

Author: Ryan Liptak

Committer: Andrew Kelley

## Message

```
Eliminate `error.InvalidHandle` from OpenError and RealPathError

InvalidHandle in OpenError is no longer a possible error on any platform. In the past it was able to be returned in `openOptionsFromFlagsWasi`, but the implementation was changed in 7680c5330cbc9141b9a5444e30c512b6068ab50d to make it no longer possible.

InvalidHandle in RealPathError was a holdover from before d5312d53a066092ba9efd687e25b29a87eb6290c, which made realpath a compile error on WASI. However, InvalidHandle was also a possible error in the FreeBSD fallback implementation added in 537624734c4db9e0cdbdc0ebce57375d17172a70. This commit changes the FreeBSD fallback implementation to return FileNotFound instead of InvalidHandle which matches how EBADF is handled in all the other `realpath` implementations (including the FreeBSD non-fallback implementation).

Closes #19084

```

## Parents

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

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