Skip to content

Commit 6e2455a

Browse files
committed
fix: add url to undici's fetch failed error
1 parent 3f3ff11 commit 6e2455a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/_utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ export async function sendFetch(
9090
const res = await fetch(url, {
9191
...options,
9292
headers: normalizeHeaders(options.headers),
93+
}).catch((error: any) => {
94+
throw new Error(`Failed to download ${url}: ${error}`);
9395
});
9496

9597
if (options.validateStatus && res.status >= 400) {

0 commit comments

Comments
 (0)