Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Rahul Sethi <5822355+RamIdeas@users.noreply.github.com>
  • Loading branch information
penalosa and RamIdeas authored Oct 14, 2024
1 parent 6daac0c commit 754b2f1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/wrangler/e2e/dev-registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ async function fetchJson<T>(url: string, info?: RequestInit): Promise<T> {
headers: { "MF-Disable-Pretty-Error": "true" },
...info,
}).then((r) => r.text());
console.log(text);
return JSON.parse(text) as T;
try {
return JSON.parse(text) as T;
} catch(cause) {
const err = new Error(`Failed to parse JSON from:\n${text}`);
err.cause = cause;
throw err;
}
},
{ timeout: 10_000, interval: 250 }
);
Expand Down

0 comments on commit 754b2f1

Please sign in to comment.