Skip to content

Commit 35e6389

Browse files
authored
Rollup merge of #110433 - ChrisDenton:notfound, r=thomcc
Windows: map a few more error codes to ErrorKind NotFound errors: * `ERROR_INVALID_DRIVE`: The system cannot find the drive specified * `ERROR_BAD_NETPATH`: The network path was not found * `ERROR_BAD_NET_NAME`: The network name cannot be found. InvalidFilename: * `ERROR_BAD_PATHNAME`: The specified path is invalid. Source: [System Error Codes (0-499)](https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-)
2 parents 0a2c0ec + db8dfbd commit 35e6389

File tree

1 file changed

+6
-3
lines changed
  • library/std/src/sys/windows

1 file changed

+6
-3
lines changed

library/std/src/sys/windows/mod.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,13 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
6868
c::ERROR_ALREADY_EXISTS => return AlreadyExists,
6969
c::ERROR_FILE_EXISTS => return AlreadyExists,
7070
c::ERROR_BROKEN_PIPE => return BrokenPipe,
71-
c::ERROR_FILE_NOT_FOUND => return NotFound,
72-
c::ERROR_PATH_NOT_FOUND => return NotFound,
71+
c::ERROR_FILE_NOT_FOUND
72+
| c::ERROR_PATH_NOT_FOUND
73+
| c::ERROR_INVALID_DRIVE
74+
| c::ERROR_BAD_NETPATH
75+
| c::ERROR_BAD_NET_NAME => return NotFound,
7376
c::ERROR_NO_DATA => return BrokenPipe,
74-
c::ERROR_INVALID_NAME => return InvalidFilename,
77+
c::ERROR_INVALID_NAME | c::ERROR_BAD_PATHNAME => return InvalidFilename,
7578
c::ERROR_INVALID_PARAMETER => return InvalidInput,
7679
c::ERROR_NOT_ENOUGH_MEMORY | c::ERROR_OUTOFMEMORY => return OutOfMemory,
7780
c::ERROR_SEM_TIMEOUT

0 commit comments

Comments
 (0)