Azure deployment setup #297
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user