Skip to content

Commit f201a4a

Browse files
committed
fix: improve error logging in apiRequest and update dryRun output
1 parent c3d0d45 commit f201a4a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

bin/chunks/sync.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ async function apiRequest(
7777
const data = await resp.json() as any;
7878

7979
if (!data.success) {
80+
console.error("API error details:", JSON.stringify({url, fetchOptions, response: {status: resp.status, statusText: resp.statusText, body: data}}, null, 2));
8081
throw new Error(
8182
`API error ${resp.status}: ${JSON.stringify(data.errors)}`
8283
);
@@ -361,7 +362,7 @@ async function dryRun() {
361362
}
362363
if (plan.toDelete.length > 0) {
363364
console.log("\n Would DELETE:");
364-
plan.toDelete.forEach((r) => console.log(` - ${r.metadata.local_id} (item: ${r.id})`));
365+
plan.toDelete.forEach((r) => console.log(` - ${r.metadata.chunk_url} (item: ${r.id})`));
365366
}
366367
}
367368

0 commit comments

Comments
 (0)