mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Improve error message for server.accept() failures
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user