Skip to content

Commit

Permalink
Add error handling on unzipping
Browse files Browse the repository at this point in the history
  • Loading branch information
luizerasmo committed Sep 18, 2018
1 parent ba5db79 commit 96b2540
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ module.exports = function (zipPath, opts, cb) {

var cancelled = false

zipfile.on('error', function (err) {
if (err) {
cancelled = true
return cb(err)
}
})

zipfile.readEntry()

zipfile.on('close', function () {
Expand Down

0 comments on commit 96b2540

Please sign in to comment.