Wrap all websocket errors, reconnect earlier

This commit is contained in:
Fedor Indutny
2021-06-14 17:12:58 -07:00
committed by GitHub
parent 8f5086227a
commit 584cedecff
3 changed files with 46 additions and 3 deletions

View File

@@ -336,9 +336,18 @@ async function _connectSocket(
reject(translatedError);
});
client.on('connectFailed', error => {
client.on('connectFailed', e => {
clearTimeout(timer);
reject(error);
reject(
makeHTTPError(
'_connectSocket connectFailed',
0,
{},
e.toString(),
stack
)
);
});
});
}