diff --git a/src/common/utils/file.ts b/src/common/utils/file.ts index d5ccf4a1..c6d6bcff 100644 --- a/src/common/utils/file.ts +++ b/src/common/utils/file.ts @@ -160,7 +160,12 @@ export async function httpDownload(options: string | HttpDownloadOptions): Promi } } } - const fetchRes = await fetch(url, { headers }); + const fetchRes = await fetch(url, { headers }).catch((err) => { + if (err.cause) { + throw err.cause; + } + throw err; + }); if (!fetchRes.ok) throw new Error(`下载文件失败: ${fetchRes.statusText}`); const blob = await fetchRes.blob();