Skip to content

Commit bb99429

Browse files
committed
fix: catch the error in sync code
1 parent b724006 commit bb99429

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/installer/util.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,13 @@ export class DefaultDownloader implements Downloader {
146146
await pipeline(this.openDownloadStream(option.url, option), createWriteStream(option.destination));
147147
return;
148148
}
149-
let chain = option.url.map((u) => () => pipeline(this.openDownloadStream(u, option), createWriteStream(option.destination)));
149+
let chain = option.url.map((u) => () => {
150+
try {
151+
return pipeline(this.openDownloadStream(u, option), createWriteStream(option.destination))
152+
} catch (e) {
153+
return Promise.reject(e);
154+
}
155+
});
150156
let promise = chain.shift()!();
151157
while (chain.length > 0) {
152158
const next = chain.shift();

0 commit comments

Comments
 (0)