mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
Add NetworkNotFound to ReadLinkError
This matches how other filesystem functions were made to handle BAD_NETWORK_PATH/BAD_NETWORK_NAME in https://github.com/ziglang/zig/pull/16568. ReadLink was the odd one out, but that is no longer the case.
This commit is contained in:
parent
84b4b6bffa
commit
e078324dbe
@ -2995,6 +2995,8 @@ pub const ReadLinkError = error{
|
||||
/// Windows-only. This error may occur if the opened reparse point is
|
||||
/// of unsupported type.
|
||||
UnsupportedReparsePointType,
|
||||
/// On Windows, `\\server` or `\\server\share` was not found.
|
||||
NetworkNotFound,
|
||||
} || UnexpectedError;
|
||||
|
||||
/// Read value of a symbolic link.
|
||||
|
||||
@ -803,6 +803,7 @@ pub fn CreateSymbolicLink(
|
||||
|
||||
pub const ReadLinkError = error{
|
||||
FileNotFound,
|
||||
NetworkNotFound,
|
||||
AccessDenied,
|
||||
Unexpected,
|
||||
NameTooLong,
|
||||
@ -850,9 +851,8 @@ pub fn ReadLink(dir: ?HANDLE, sub_path_w: []const u16, out_buffer: []u8) ReadLin
|
||||
.OBJECT_NAME_NOT_FOUND => return error.FileNotFound,
|
||||
.OBJECT_PATH_NOT_FOUND => return error.FileNotFound,
|
||||
.NO_MEDIA_IN_DEVICE => return error.FileNotFound,
|
||||
// TODO: Should BAD_NETWORK_* be translated to a different error?
|
||||
.BAD_NETWORK_PATH => return error.FileNotFound, // \\server was not found
|
||||
.BAD_NETWORK_NAME => return error.FileNotFound, // \\server was found but \\server\share wasn't
|
||||
.BAD_NETWORK_PATH => return error.NetworkNotFound, // \\server was not found
|
||||
.BAD_NETWORK_NAME => return error.NetworkNotFound, // \\server was found but \\server\share wasn't
|
||||
.INVALID_PARAMETER => unreachable,
|
||||
.SHARING_VIOLATION => return error.AccessDenied,
|
||||
.ACCESS_DENIED => return error.AccessDenied,
|
||||
|
||||
@ -833,6 +833,7 @@ pub fn abiAndDynamicLinkerFromFile(
|
||||
error.InvalidUtf8 => unreachable, // Windows only
|
||||
error.BadPathName => unreachable, // Windows only
|
||||
error.UnsupportedReparsePointType => unreachable, // Windows only
|
||||
error.NetworkNotFound => unreachable, // Windows only
|
||||
|
||||
error.AccessDenied,
|
||||
error.FileNotFound,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user