From 8c713ef1bd0ca9f83e1b1b8560190245c80b688e Mon Sep 17 00:00:00 2001 From: Quentin Dreyer Date: Thu, 9 Aug 2018 20:14:58 +0200 Subject: [PATCH] fix(browserfetcher): handle extract-zip errors (#3052) --- lib/BrowserFetcher.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/BrowserFetcher.js b/lib/BrowserFetcher.js index 0eb5cc94..a550cfc5 100644 --- a/lib/BrowserFetcher.js +++ b/lib/BrowserFetcher.js @@ -233,7 +233,12 @@ function downloadFile(url, destinationPath, progressCallback) { * @return {!Promise} */ 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) {