code: function createConnectTimeoutErr(opts, req) {
      assert.object(opts, 'opts');
      assert.object(req, 'req');
  
      var errInfo = createErrInfo(opts, req);
      var errMsg;
      var errName;
  
      // if remoteAddress has not yet been resolved, DNS resolution could have
      // failed. verify this by checking if the input was an IP to begin with,
      // if it was, lookup was never called anyway so its a real connect timeout
      // error.
      if (!req.remoteAddress) {
          errName = 'DNSTimeoutError';
          errMsg = [
              'failed to resolve hostname',
              '`' + opts.hostname + '`',
              'within',
              opts.connectTimeout + 'ms'
          ].join(' ');
      } else {
          errName = 'ConnectTimeoutError';
          errMsg = [
              opts.method,
              'request to',
              errInfo.fullUrl,
              'failed to obtain connected socket within',
              opts.connectTimeout + 'ms'
          ].join(' ');
      }
  
      return new ERR_CTOR[errName]({
          info: _.assign(errInfo, {
              connectTimeout: opts.connectTimeout
          })
      }, '%s', errMsg);
  }
docs: /*------------------------------------------------------------------------------
  public methods
  ------------------------------------------------------------------------------ 
  build a connect timeout error for a request that failed to resolve DNS or
  establish a connection.
  @public
  @function createConnectTimeoutErr
  @param {Object} opts options object for a request
  @param {Object} req the request object
  @returns {verror.VError} ConnectionTimeoutError