This repository has been archived by the owner on Apr 8, 2020. It is now read-only.
forked from max-mapper/extract-zip
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
馃悰Added missing error event handler (#1)
- Loading branch information
Showing
1 changed file
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,14 @@ module.exports = function (zipPath, opts, cb) { | |
|
||
zipfile.readEntry() | ||
|
||
zipfile.on('error', function (err) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
aileen
Author
Member
|
||
cancelled = true | ||
if (err) { | ||
return cb(err) | ||
} | ||
return cb(new Error('Error reading zip file')) | ||
}) | ||
|
||
zipfile.on('close', function () { | ||
if (!cancelled) { | ||
debug('zip extraction complete') | ||
|
@AileenCGN as part of cleanup, please can you PR this back to the main project?
We don't actually use this in Ghost, only in gscan, and it's now behind the main project.
Alternatively, we could look to switch to using adm-zip everywhere (used in Ghost-CLI and migrate)