Problem
frontend/src/lib/api.ts only treats application/json as a JSON response:
const isJson = contentType.includes('application/json')
All backend errors are RFC 7807 application/problem+json (per app/core/problem_details.py, the project standard since Phase 7). "application/problem+json".includes("application/json") is false, so error bodies are never parsed:
ApiError.detail is always {} for error responses.
getErrorMessage() falls back to error.message, which is the raw JSON string of the problem body.
- Every
ErrorDisplay in the SPA renders the raw RFC 7807 JSON blob instead of the human-readable detail.
Impact
Repo-wide — affects every error surface in the frontend, not a single page. Latent since Phase 7/10 (#43, #78) because error states are off the happy path and rarely dogfooded.
Discovery
Surfaced while dogfooding the Forecast Explainability slice (#224): the ExplanationPanel on /visualize/forecast renders explanation errors as an expected in-card state, making the raw-JSON leak visible.
Fix
One line — match the +json structured-syntax suffix as well:
const isJson =
contentType.includes('application/json') || contentType.includes('+json')
Note
The fix ships in the #224 explainability PR (the slice's error UX depends on it). This issue tracks the root-cause repo-wide bug for the record.
Problem
frontend/src/lib/api.tsonly treatsapplication/jsonas a JSON response:All backend errors are RFC 7807
application/problem+json(perapp/core/problem_details.py, the project standard since Phase 7)."application/problem+json".includes("application/json")isfalse, so error bodies are never parsed:ApiError.detailis always{}for error responses.getErrorMessage()falls back toerror.message, which is the raw JSON string of the problem body.ErrorDisplayin the SPA renders the raw RFC 7807 JSON blob instead of the human-readabledetail.Impact
Repo-wide — affects every error surface in the frontend, not a single page. Latent since Phase 7/10 (#43, #78) because error states are off the happy path and rarely dogfooded.
Discovery
Surfaced while dogfooding the Forecast Explainability slice (#224): the
ExplanationPanelon/visualize/forecastrenders explanation errors as an expected in-card state, making the raw-JSON leak visible.Fix
One line — match the
+jsonstructured-syntax suffix as well:Note
The fix ships in the #224 explainability PR (the slice's error UX depends on it). This issue tracks the root-cause repo-wide bug for the record.