MCPcopy Create free account
hub / github.com/nodejs/node / getReplyErrorMessage

Method getReplyErrorMessage

deps/undici/src/lib/core/socks5-client.js:391–412  ·  view source on GitHub ↗

* Get human-readable error message for reply code

(reply)

Source from the content-addressed store, hash-verified

389 * Get human-readable error message for reply code
390 */
391 getReplyErrorMessage (reply) {
392 switch (reply) {
393 case REPLY_CODES.GENERAL_FAILURE:
394 return 'General SOCKS server failure'
395 case REPLY_CODES.CONNECTION_NOT_ALLOWED:
396 return 'Connection not allowed by ruleset'
397 case REPLY_CODES.NETWORK_UNREACHABLE:
398 return 'Network unreachable'
399 case REPLY_CODES.HOST_UNREACHABLE:
400 return 'Host unreachable'
401 case REPLY_CODES.CONNECTION_REFUSED:
402 return 'Connection refused'
403 case REPLY_CODES.TTL_EXPIRED:
404 return 'TTL expired'
405 case REPLY_CODES.COMMAND_NOT_SUPPORTED:
406 return 'Command not supported'
407 case REPLY_CODES.ADDRESS_TYPE_NOT_SUPPORTED:
408 return 'Address type not supported'
409 default:
410 return `Unknown error code: ${reply}`
411 }
412 }
413}
414
415module.exports = {

Callers 1

handleConnectResponseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected