mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 19:07:49 +00:00
Improve zlib error handling. [#109]
Former-commit-id: f6d7dd9afb630125d55188401da037ed97d6e5c5
This commit is contained in:
@@ -63,13 +63,15 @@
|
|||||||
'Accept': 'application/vnd.github.v3.raw'
|
'Accept': 'application/vnd.github.v3.raw'
|
||||||
}
|
}
|
||||||
}, function(response) {
|
}, function(response) {
|
||||||
|
var decompressor = zlib.createUnzip().on('error', callback);
|
||||||
|
|
||||||
var parser = new tar.Extract({
|
var parser = new tar.Extract({
|
||||||
'path': options.path
|
'path': options.path
|
||||||
})
|
})
|
||||||
.on('end', callback)
|
.on('end', callback)
|
||||||
.on('error', callback);
|
.on('error', callback);
|
||||||
|
|
||||||
response.pipe(zlib.createUnzip()).pipe(parser);
|
response.pipe(decompressor).pipe(parser);
|
||||||
})
|
})
|
||||||
.on('error', callback);
|
.on('error', callback);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user