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); }