http: remove internal error in assignSocket

Change ServerResponse.assignSocket to not throw an internal error,
but an error with its own code.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/47723
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This commit is contained in:
Matteo Collina authored and GitHub committed 2023-05-02 20:02:17 +00:00
1 parent d2156f1bf0
commit 46c3f4da05
4 files changed
+19 -1

No files matched your search

+7
View File
@@ -1438,6 +1438,12 @@ Status code was outside the regular status code range (100-999).
The client has not sent the entire request within the allowed time.
<a id="ERR_HTTP_SOCKET_ASSIGNED"></a>
### `ERR_HTTP_SOCKET_ASSIGNED`
The given [`ServerResponse`][] was already assigned a socket.
<a id="ERR_HTTP_SOCKET_ENCODING"></a>
### `ERR_HTTP_SOCKET_ENCODING`
@@ -3590,6 +3596,7 @@ The native call from `process.cpuUsage` could not be processed.
[`Object.getPrototypeOf`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf
[`Object.setPrototypeOf`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf
[`REPL`]: repl.md
[`ServerResponse`]: http.md#class-httpserverresponse
[`Writable`]: stream.md#class-streamwritable
[`child_process`]: child_process.md
[`cipher.getAuthTag()`]: crypto.md#ciphergetauthtag