Skip to content

fix: surface dashboard API error messages - #2

Open
Topleess wants to merge 1 commit into
Katzca:mainfrom
Topleess:fix/dashboard-api-errors
Open

fix: surface dashboard API error messages#2
Topleess wants to merge 1 commit into
Katzca:mainfrom
Topleess:fix/dashboard-api-errors

Conversation

@Topleess

Copy link
Copy Markdown

Summary

  • surface backend-provided error messages in the dashboard instead of only showing an HTTP status
  • fall back to API Error: <status> when an error response is not valid JSON
  • extract the small API client so its success and failure behavior can be tested without loading the full dashboard

Motivation

While testing the self-hosted dashboard, failed actions such as platform login returned useful JSON error details from the backend, but the UI discarded them and displayed only messages such as API Error: 400. This made setup and recovery unnecessarily difficult.

Test plan

  • node --test test/api-client.test.js
  • npm run check (24 tests pass)
  • dashboard smoke test confirms api-client.js is served and loaded before app.js

Notes

npm audit --omit=dev still reports the repository's existing low-severity body-parser advisory; this PR does not change dependencies.

Extract the dashboard API client into a testable module and display backend-provided error details when requests fail. Fall back to the HTTP status when a response is not JSON.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant