Reject promise when https.get fails. Fix #49
This commit is contained in:
Родитель
ff61af079c
Коммит
487a134ea8
|
@ -71,18 +71,20 @@ async function downloadVSCodeArchive(version: DownloadVersion): Promise<string>
|
|||
outStream.on('close', () => {
|
||||
resolve(archivePath);
|
||||
});
|
||||
|
||||
https.get(archiveRequestOptions, res => {
|
||||
res.pipe(outStream);
|
||||
});
|
||||
}).on('error', e => reject(e));
|
||||
} else {
|
||||
const zipPath = path.resolve(vscodeTestDir, `vscode-${version}.tgz`);
|
||||
const outStream = fs.createWriteStream(zipPath);
|
||||
https.get(archiveRequestOptions, res => {
|
||||
res.pipe(outStream);
|
||||
});
|
||||
outStream.on('close', () => {
|
||||
resolve(zipPath);
|
||||
});
|
||||
|
||||
https.get(archiveRequestOptions, res => {
|
||||
res.pipe(outStream);
|
||||
}).on('error', e => reject(e));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче