mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
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:
parent
42fa3af659
commit
e95fb96279
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user