code: function exceptionWithHostPort(err, syscall, address, port, additional) {
    // TODO(joyeecheung): We have to use the type-checked
    // getSystemErrorName(err) to guard against invalid arguments from users.
    // This can be replaced with [ code ] = errmap.get(err) when this method
    // is no longer exposed to user land.
    if (util === undefined) util = require('util');
    const code = util.getSystemErrorName(err);
    let details = '';
    if (port && port > 0) {
      details = ` ${address}:${port}`;
    } else if (address) {
      details = ` ${address}`;
    }
    if (additional) {
      details += ` - Local (${additional})`;
    }
  
    // eslint-disable-next-line no-restricted-syntax
    const ex = new Error(`${syscall} ${code}${details}`);
    // TODO(joyeecheung): errno is supposed to err, like in uvException
    ex.code = ex.errno = code;
    ex.syscall = syscall;
    ex.address = address;
    if (port) {
      ex.port = port;
    }
  
    Error.captureStackTrace(ex, exceptionWithHostPort);
    return ex;
  }
docs: This used to be util._exceptionWithHostPort().
  
  @param {number} err - A libuv error number
  @param {string} syscall
  @param {string} address
  @param {number} [port]
  @param {string} [additional]
  @returns {Error}