Throw an error when Chromium download is failed (#619)

This patch teaches ChromiumDownloader to throw an error if
downloading failed.
This commit is contained in:
Abdulaziz Homaily 2017-09-02 00:47:57 +08:00 committed by Andrey Lushnikov
parent 42fa3af659
commit e95fb96279

View File

@ -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;
}
}