Browse Source

Refactor column validation in File class to emit parse error event when columns are invalid

node16
Onja 12 months ago
parent
commit
df08062ffb
  1. 3
      src/models/file.js

3
src/models/file.js

@ -124,8 +124,9 @@ class File {
const stream = new PassThrough(); const stream = new PassThrough();
// check if columns is valid // check if columns is valid
if (!columns || columns.length) { if (!columns || !columns.length) {
// return Promise.reject(new Error('Invalid columns')); // return Promise.reject(new Error('Invalid columns'));
emitter.emit('parse.error', { url: this.url, filepath: this.filepath, error: 'Invalid columns' });
return false; return false;
} }

Loading…
Cancel
Save