<commit_before>
var util = require('util');
var stream = require('stream');

function ReadFilter(source, levels) {
  stream.Transform.call(this, {
    objectMode: true,
    highWaterMark: 16
  });
  var self = this;

  this._source = source;
  this._levels = levels;
  this._error = null;

  source.once('error', function (err) {
    self._error = err;
    self.close();
  });
  source.pipe(this);
}
util.inherits(ReadFilter, stream.Transform);
module.exports = ReadFilter;
<commit_msg>[fix] call correct method on read error<commit_after>
var util = require('util');
var stream = require('stream');

function ReadFilter(source, levels) {
  stream.Transform.call(this, {
    objectMode: true,
    highWaterMark: 16
  });
  var self = this;

  this._source = source;
  this._levels = levels;
  this._error = null;

  source.once('error', function (err) {
    self._error = err;
    self.destroy();
  });
  source.pipe(this);
}
util.inherits(ReadFilter, stream.Transform);
module.exports = ReadFilter;

{'fraction_non_alphanumeric': 0.148, 'fraction_numerical': 0.004, 'mean_word_length': 3.9310344827586206, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5586956', 'n_tokens_mistral': 331, 'n_tokens_neox': 319, 'n_words': 76}