You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GZIP + Error: ENOENT: no such file or directory #15
If you use gzip: true, and the file doesn't exist, the module throws an unhandles exception:
{ Error: ENOENT: no such file or directory, open 'asd' errno: -2, code: 'ENOENT', syscall: 'open', path: 'asd' }
The issue is in the big-xml.js file, starting line 20:
if (options.gzip) {
var gunzip = zlib.createGunzip();
stream.pipe(gunzip);
stream = gunzip;
}
After this, in line 34, there is indeed an intended error handling:
stream.on('error', function(err) {
self.emit('error', new Error(err));
});
But since here the stream variable is not var stream = fs.createReadStream(filename);
anymore, it cannot catch errors from from the original stream variable.
My idea to fix this would be to raise the stream.on before the if block, and add a plus error listener in the if block :
stream.on('error', function(err) {
self.emit('error', new Error(err));
});
if (options.gzip) {
var gunzip = zlib.createGunzip();
gunzip.on('error', function(err) {
self.emit('error', new Error(err));
});
stream.pipe(gunzip);
stream = gunzip;
}
Activity
Merge GZIP + Error: ENOENT: no such file or directory jahewson#15 fro…