Skip to content

Commit

Permalink
Throw an error when Chromium download is failed (#619)
Browse files Browse the repository at this point in the history
This patch teaches ChromiumDownloader to throw an error if
downloading failed.
  • Loading branch information
homaily authored and aslushnikov committed Sep 1, 2017
1 parent 42fa3af commit e95fb96
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions utils/ChromiumDownloader.js
Expand Up @@ -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;
});
},

Expand Down Expand Up @@ -234,4 +236,4 @@ function requestOptions(url, method = 'GET') {
}

return result;
}
}

0 comments on commit e95fb96

Please sign in to comment.