fix(browserfetcher): handle extract-zip errors (#3052)

This commit is contained in:
Quentin Dreyer 2018-08-09 20:14:58 +02:00 committed by Andrey Lushnikov
parent 40466cb3a4
commit 8c713ef1bd

View File

@ -233,7 +233,12 @@ function downloadFile(url, destinationPath, progressCallback) {
* @return {!Promise<?Error>}
*/
function extractZip(zipPath, folderPath) {
return new Promise(fulfill => extract(zipPath, {dir: folderPath}, fulfill));
return new Promise((fulfill, reject) => extract(zipPath, {dir: folderPath}, err => {
if (err)
reject(err);
else
fulfill();
}));
}
function httpRequest(url, method, response) {