From 6c1728206288264c4d2508a190d392ade68d115c Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 4 Nov 2019 14:39:59 -0500 Subject: [PATCH] std.os.read can fail with ConnectionResetByPeer --- lib/std/os.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/std/os.zig b/lib/std/os.zig index efddc9aafb..f45b03130c 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -274,6 +274,7 @@ pub const ReadError = error{ IsDir, OperationAborted, BrokenPipe, + ConnectionResetByPeer, /// This error occurs when no global event loop is configured, /// and reading from the file descriptor would block. @@ -320,6 +321,7 @@ pub fn read(fd: fd_t, buf: []u8) ReadError!usize { EISDIR => return error.IsDir, ENOBUFS => return error.SystemResources, ENOMEM => return error.SystemResources, + ECONNRESET => return error.ConnectionResetByPeer, else => |err| return unexpectedErrno(err), } }