MCPcopy Index your code
hub / github.com/nodejs/node / handleConnectError

Function handleConnectError

deps/undici/undici.js:9850–9884  ·  view source on GitHub ↗
(client, err, { host, hostname, protocol, port })

Source from the content-addressed store, hash-verified

9848 }
9849 __name(connect, "connect");
9850 function handleConnectError(client, err, { host, hostname, protocol, port }) {
9851 if (client.destroyed) {
9852 return;
9853 }
9854 client[kConnecting] = false;
9855 if (channels.connectError.hasSubscribers) {
9856 channels.connectError.publish({
9857 connectParams: {
9858 host,
9859 hostname,
9860 protocol,
9861 port,
9862 version: client[kHTTPContext]?.version,
9863 servername: client[kServerName],
9864 localAddress: client[kLocalAddress]
9865 },
9866 connector: client[kConnector],
9867 error: err
9868 });
9869 }
9870 if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
9871 const running = client[kQueue].splice(client[kRunningIdx], client[kRunning]);
9872 client[kPendingIdx] = client[kRunningIdx];
9873 for (let i = 0; i < running.length; i++) {
9874 util.errorRequest(client, running[i], err);
9875 }
9876 while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
9877 const request = client[kQueue].splice(client[kPendingIdx], 1)[0];
9878 util.errorRequest(client, request, err);
9879 }
9880 } else {
9881 onError(client, err);
9882 }
9883 client.emit("connectionError", client[kUrl], [client], err);
9884 }
9885 __name(handleConnectError, "handleConnectError");
9886 function emitDrain(client) {
9887 client[kNeedDrain] = 0;

Callers 1

connectFunction · 0.70

Calls 3

onErrorFunction · 0.70
publishMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…