From 2da31a2474f05560c5ac7c82079998cb0948a580 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Wed, 25 Mar 2026 11:48:57 +0100 Subject: [PATCH] added more logging --- frontend/src/pages/index.astro | 3 ++- frontend/src/pages/posts/[slug].astro | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/index.astro b/frontend/src/pages/index.astro index b6809f0..ff34cd4 100644 --- a/frontend/src/pages/index.astro +++ b/frontend/src/pages/index.astro @@ -19,7 +19,8 @@ try { error = 'Failed to fetch posts'; } } catch (e) { - error = `Could not connect to backend at ${API_URL}: ${e instanceof Error ? e.message : String(e)}`; + const cause = (e as any)?.cause; + error = `Could not connect to backend at ${API_URL}: ${e instanceof Error ? e.message : String(e)}${cause ? ' (Cause: ' + (cause.message || cause.code || JSON.stringify(cause)) + ')' : ''}`; console.error(error); } diff --git a/frontend/src/pages/posts/[slug].astro b/frontend/src/pages/posts/[slug].astro index bb1c028..d0fa7ff 100644 --- a/frontend/src/pages/posts/[slug].astro +++ b/frontend/src/pages/posts/[slug].astro @@ -25,7 +25,8 @@ try { error = 'Post not found'; } } catch (e) { - error = `Could not connect to backend at ${API_URL}: ${e instanceof Error ? e.message : String(e)}`; + const cause = (e as any)?.cause; + error = `Could not connect to backend at ${API_URL}: ${e instanceof Error ? e.message : String(e)}${cause ? ' (Cause: ' + (cause.message || cause.code || JSON.stringify(cause)) + ')' : ''}`; console.error(error); }