Skip to content

Commit

Permalink
feat: print attempted addresses on ConnectTimeoutError
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Dec 3, 2023
1 parent 8535d8c commit 72c38cc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/core/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ function setupTimeout (onConnectTimeout, timeout) {
}

function onConnectTimeout (socket) {
util.destroy(socket, new ConnectTimeoutError())
let message = 'Connect Timeout Error';

Check failure on line 186 in lib/core/connect.js

View workflow job for this annotation

GitHub Actions / lint

Extra semicolon
if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) {
message =+ ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')})`;

Check failure on line 188 in lib/core/connect.js

View workflow job for this annotation

GitHub Actions / lint

Operator '=' must be spaced

Check failure on line 188 in lib/core/connect.js

View workflow job for this annotation

GitHub Actions / lint

Unexpected space after unary operator '+'

Check failure on line 188 in lib/core/connect.js

View workflow job for this annotation

GitHub Actions / lint

Extra semicolon
}
util.destroy(socket, new ConnectTimeoutError(message))
}

module.exports = buildConnector

0 comments on commit 72c38cc

Please sign in to comment.