Skip to content

Commit 2b200d0

Browse files
committed
std.posix.read: should expect ConnectionRefused
Closes: #20219
1 parent fc2c188 commit 2b200d0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/std/fs/File.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,7 @@ pub fn writeFileAll(self: File, in_file: File, args: WriteFileOptions) WriteFile
14871487
error.FileDescriptorNotASocket,
14881488
error.NetworkUnreachable,
14891489
error.NetworkSubsystemFailed,
1490+
error.ConnectionRefused,
14901491
=> return self.writeFileAllUnseekable(in_file, args),
14911492

14921493
else => |e| return e,

lib/std/posix.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6088,6 +6088,9 @@ pub const SendError = error{
60886088

60896089
/// The local network interface used to reach the destination is down.
60906090
NetworkSubsystemFailed,
6091+
6092+
/// The destination address is not listening.
6093+
ConnectionRefused,
60916094
} || UnexpectedError;
60926095

60936096
pub const SendMsgError = SendError || error{
@@ -6319,7 +6322,6 @@ pub fn send(
63196322
error.AddressNotAvailable => unreachable,
63206323
error.SocketNotConnected => unreachable,
63216324
error.UnreachableAddress => unreachable,
6322-
error.ConnectionRefused => unreachable,
63236325
else => |e| return e,
63246326
};
63256327
}

0 commit comments

Comments
 (0)