From 1a51f16ee016e3263f093201e88bb4ae8d394942 Mon Sep 17 00:00:00 2001 From: Harkamal Randhawa Date: Tue, 14 Apr 2026 22:56:54 -0600 Subject: [PATCH] show error details --- web/lib/fetchAllPages.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/lib/fetchAllPages.js b/web/lib/fetchAllPages.js index 624d172c..4e563d83 100644 --- a/web/lib/fetchAllPages.js +++ b/web/lib/fetchAllPages.js @@ -6,7 +6,9 @@ export async function fetchAllPages(urlBuilder) { while (page < totalPages) { const res = await fetch(urlBuilder(page)); if (!res.ok) { - throw new Error(`HTTP ${res.status} – ${res.statusText}`); + const body = await res.text().catch(() => '') + const detail = body ? `: ${body.slice(0, 200)}` : '' + throw new Error(`HTTP ${res.status}${detail}`) } const data = await res.json();