added more logging

This commit is contained in:
2026-03-25 11:48:57 +01:00
parent 2723fb0ca3
commit 2da31a2474
2 changed files with 4 additions and 2 deletions

View File

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