From e95fb9627962755df3bf711afe4d96d6d257b0be Mon Sep 17 00:00:00 2001 From: Abdulaziz Homaily Date: Sat, 2 Sep 2017 00:47:57 +0800 Subject: [PATCH] Throw an error when Chromium download is failed (#619) This patch teaches ChromiumDownloader to throw an error if downloading failed. --- utils/ChromiumDownloader.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/ChromiumDownloader.js b/utils/ChromiumDownloader.js index 611ecb56030..6992d991f10 100644 --- a/utils/ChromiumDownloader.js +++ b/utils/ChromiumDownloader.js @@ -98,9 +98,11 @@ module.exports = { return downloadFile(url, zipPath, progressCallback) .then(() => extractZip(zipPath, folderPath)) .catch(err => err) - .then(() => { + .then(err => { if (fs.existsSync(zipPath)) fs.unlinkSync(zipPath); + if (err) + throw err; }); }, @@ -234,4 +236,4 @@ function requestOptions(url, method = 'GET') { } return result; -} \ No newline at end of file +}