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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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
)
);
});
});
}