mafintosh / tar-stream

tar-stream is a streaming tar parser and generator.
MIT License
406 stars 92 forks source link

No error on invalid input #71

Closed kevinresol closed 6 years ago

kevinresol commented 7 years ago

The following code tries to pipe some nonsense into an extractor:

var tar = require('tar-stream');
var stream = require('stream');
var extract = tar.extract();

extract.on('error', function(e) {
    console.log(e);
});

extract.on('entry', function(header, stream, next) {
    console.log(header);
});

extract.on('finish', function() {
    console.log('finish');
});

var input = new stream.PassThrough();

input.pipe(extract);

input.end(new Buffer('some random content'));

The only output is finish, but it should really emit some sort of error

Qix- commented 7 years ago

Uh yeah I'm facing a bug where this isn't erroring at all. Took me 3 hours to track down it was from this module.

This really needs proper error handling.

mafintosh commented 6 years ago

Should be fixed. Re-open if not.