Skip to content

ChartView /api/<apiCall> fetch needs a response.ok guard #182

Description

@skearnes

Noted during review of #179 (review).

The data-fetch effect in ChartView calls fetch(/api/\${apiCall}?...) and pipes the response through .then(r => r.json()) with no response.ok gate. On a 4xx/5xx the JSON parse either throws on the HTML body or feeds a nonsense object into setInputsData / createChart.

Add the same if (!response.ok) throw guard the sibling getMolHtml function uses after d568ef3, and surface the failure to the user instead of leaving the loading spinner up.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions