From f201a4aeeceffcfc0c90d65d12e70edb9e1c0564 Mon Sep 17 00:00:00 2001 From: Martin Trapp <94928215+martrapp@users.noreply.github.com> Date: Wed, 10 Jun 2026 16:15:27 +0200 Subject: [PATCH] fix: improve error logging in apiRequest and update dryRun output --- bin/chunks/sync.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/chunks/sync.ts b/bin/chunks/sync.ts index d4a33c6..49b7bcf 100644 --- a/bin/chunks/sync.ts +++ b/bin/chunks/sync.ts @@ -77,6 +77,7 @@ async function apiRequest( const data = await resp.json() as any; if (!data.success) { + console.error("API error details:", JSON.stringify({url, fetchOptions, response: {status: resp.status, statusText: resp.statusText, body: data}}, null, 2)); throw new Error( `API error ${resp.status}: ${JSON.stringify(data.errors)}` ); @@ -361,7 +362,7 @@ async function dryRun() { } if (plan.toDelete.length > 0) { console.log("\n Would DELETE:"); - plan.toDelete.forEach((r) => console.log(` - ${r.metadata.local_id} (item: ${r.id})`)); + plan.toDelete.forEach((r) => console.log(` - ${r.metadata.chunk_url} (item: ${r.id})`)); } } -- knotmirror 0.0.1