fix(FN-1287): standardize dashboard API error responses

- Add shared ApiError class and response helpers for consistent error shape
- Migrate routes and mission-routes handlers to use standardized API errors
- Update server error middleware, rate limiter, and node metrics error handling to use shared helpers
- Expand dashboard tests with ApiError coverage and standardized response assertions
- Add a changeset documenting the @gsxdsm/fusion patch for API error shape standardization
This commit is contained in:
gsxdsm
2026-04-08 12:37:47 -07:00
parent def7b82a7f
commit 156d49f70b
10 changed files with 2085 additions and 1373 deletions

View File

@@ -313,6 +313,15 @@ describe("Node routes", () => {
});
});
it("GET /api/nodes/:id/metrics returns 501 for remote nodes", async () => {
mockGetNode.mockResolvedValue(makeNode({ id: "node_2", type: "remote" }));
const res = await request(app, "GET", "/api/nodes/node_2/metrics");
expect(res.status).toBe(501);
expect(res.body).toEqual({ error: "Remote node metrics not yet implemented" });
});
it("PATCH /api/projects/:id assigns project to node when nodeId is provided", async () => {
const res = await request(
app,