fix(chart): add detailed error logging to debug 500 error

- Add step-by-step console logging in API route
- Show actual error message in dialog
- Add debug info section
- Wrap each section in try-catch to isolate failure point
This commit is contained in:
Antigravity
2026-05-23 09:39:16 +00:00
parent 54385e9f10
commit 76cbdd338b
2 changed files with 55 additions and 8 deletions

View File

@@ -176,7 +176,14 @@ export function ChartSuggestionsDialog({
<div className="text-center max-w-md">
<AlertCircle className="w-12 h-12 mx-auto mb-4 text-destructive" />
<h3 className="text-lg font-semibold mb-2">Error</h3>
<p className="text-muted-foreground">{response.error}</p>
<p className="text-sm text-muted-foreground mb-2">{response.error}</p>
<details className="text-left text-xs text-muted-foreground mt-4">
<summary className="cursor-pointer hover:text-foreground">Debug info</summary>
<pre className="mt-2 bg-muted p-2 rounded overflow-auto max-h-32">
analyzedText: {response.analyzedText}
{'\n'}detectedData: {response.detectedData}
</pre>
</details>
</div>
</div>
) : !response?.hasData ? (