code: function(self) {
    return function(err) {
      if (connectionAccounting) deleteConnection(self.id);
      // Debug information
      if (self.logger.isDebug())
        self.logger.debug(
          f(
            'connection %s for [%s:%s] errored out with [%s]',
            self.id,
            self.host,
            self.port,
            JSON.stringify(err)
          )
        );
      // Emit the error
      if (self.listeners('error').length > 0) self.emit('error', new MongoNetworkError(err), self);
    };
  }
docs: Connection handlers