Skip to content

Commit c1beff5

Browse files
committed
std.fs: improve error-handling for openDirW
1 parent 4c7f828 commit c1beff5

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
@@ -1790,7 +1790,7 @@ pub const Dir = struct {
17901790
);
17911791
switch (rc) {
17921792
.SUCCESS => return result,
1793-
.OBJECT_NAME_INVALID => unreachable,
1793+
.OBJECT_NAME_INVALID => return error.NotDir,
17941794
.OBJECT_NAME_NOT_FOUND => return error.FileNotFound,
17951795
.OBJECT_PATH_NOT_FOUND => return error.FileNotFound,
17961796
.NOT_A_DIRECTORY => return error.NotDir,

0 commit comments

Comments
 (0)