()
| 494 | Effect.callback<NodeWS.WebSocket, Socket.SocketError>((resume) => { |
| 495 | // A refused handshake never invokes the callback, so fail on close instead. |
| 496 | const onClose = () => |
| 497 | resume(Effect.fail( |
| 498 | new Socket.SocketError({ |
| 499 | reason: new Socket.SocketOpenError({ |
| 500 | kind: "Unknown", |
| 501 | cause: new Error("The socket closed before the upgrade") |
| 502 | }) |
| 503 | }) |
| 504 | )) |
| 505 | if (socket.destroyed) return onClose() |
| 506 | socket.once("close", onClose) |
| 507 | wss.handleUpgrade(nodeRequest, socket, head, (ws) => { |
no test coverage detected