Skip to content

Commit

Permalink
fix: add url to undici's fetch failed error
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 23, 2023
1 parent 3f3ff11 commit 6e2455a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ export async function sendFetch(
const res = await fetch(url, {
...options,
headers: normalizeHeaders(options.headers),
}).catch((error: any) => {
throw new Error(`Failed to download ${url}: ${error}`);
});

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

0 comments on commit 6e2455a

Please sign in to comment.