From 32ad95aa34775e996eb9860dfd5bada66fa05d67 Mon Sep 17 00:00:00 2001 From: Claude Bot Date: Thu, 16 Oct 2025 21:05:51 +0000 Subject: [PATCH] Improve error message for server.accept() failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enhanced the error message to include: - The actual file descriptor number that failed - Guidance on common failure causes (invalid socket FD, SSL mismatch) This helps users diagnose issues more quickly when accept() fails. Addresses CodeRabbit review comment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/bun.js/api/server.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig index 22f72e51e8..ab3ffd7cc2 100644 --- a/src/bun.js/api/server.zig +++ b/src/bun.js/api/server.zig @@ -1835,7 +1835,7 @@ pub fn NewServer(protocol_enum: enum { http, https }, development_kind: enum { d const result = app.accept(bun.FileDescriptor.fromUV(@intCast(fd))); if (result != 0) { - return globalThis.throwInvalidArguments("Failed to accept file descriptor", .{}); + return globalThis.throwInvalidArguments("Failed to accept file descriptor {d}. Ensure it is a valid socket file descriptor and matches the server's SSL configuration.", .{fd}); } return .js_undefined;