Skip to content

Commit 4b24a10

Browse files
yuyoyuppeandrewrk
authored andcommitted
std.fs: improve error-handling for openDirW
1 parent 329a585 commit 4b24a10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/std/fs.zig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1820,7 +1820,7 @@ pub const Dir = struct {
18201820
);
18211821
switch (rc) {
18221822
.SUCCESS => return result,
1823-
.OBJECT_NAME_INVALID => unreachable,
1823+
.OBJECT_NAME_INVALID => return error.NotDir,
18241824
.OBJECT_NAME_NOT_FOUND => return error.FileNotFound,
18251825
.OBJECT_PATH_NOT_FOUND => return error.FileNotFound,
18261826
.NOT_A_DIRECTORY => return error.NotDir,

0 commit comments

Comments
 (0)