Update file.ts

This commit is contained in:
idranme authored and GitHub committed 2024-07-10 11:35:55 +08:00
1 parent 335a97d425
commit 56254cf518
1 file changed
+3 -3
+3 -3
View File
@@ -161,10 +161,10 @@ export async function httpDownload(options: string | HttpDownloadOptions): Promi
}
}
const fetchRes = await fetch(url, { headers }).catch((err) => {
if(err.cause){
throw err.cause
if (err.cause) {
throw err.cause;
}
throw err
throw err;
});
if (!fetchRes.ok) throw new Error(`下载文件失败: ${fetchRes.statusText}`);