diff --git a/src/models/file.js b/src/models/file.js index e54d11a..69bb411 100644 --- a/src/models/file.js +++ b/src/models/file.js @@ -124,8 +124,9 @@ class File { const stream = new PassThrough(); // check if columns is valid - if (!columns || columns.length) { + if (!columns || !columns.length) { // return Promise.reject(new Error('Invalid columns')); + emitter.emit('parse.error', { url: this.url, filepath: this.filepath, error: 'Invalid columns' }); return false; }