BillTracker/utils
null 7390c458ed refactor(routes): categories → uniform Express-5 throw pattern (Pillar B template)
Establishes the canonical route error pattern (see docs/CODE_STANDARDS.md):
handlers `throw ValidationError/NotFoundError/ConflictError(...)` and let
Express 5 forward to the single terminal handler — no per-handler
try/catch swallows, no ad-hoc `res.status().json({error})`. Only the
UNIQUE-constraint → 409 mapping keeps a tight try/catch (`asConflict`).

- apiError factories NotFoundError/ConflictError now take an optional
  `field` (parity with ValidationError) so form-field info is preserved.
- routes/categories.cts fully converted; identical status/messages, now
  uniform `{ error, message, code, field }` bodies.
- Test harnesses (categoryGroups, categoryReorder) updated to simulate the
  terminal handler (thrown ApiError → formatted response).

Verified: 236/236 server tests; e2e probe 17/17; live smoke confirms
400 VALIDATION_ERROR / 404 NOT_FOUND with correct field + status.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 14:46:32 -05:00
..
apiError.cts refactor(routes): categories → uniform Express-5 throw pattern (Pillar B template) 2026-07-06 14:46:32 -05:00
dates.mts feat(server-ts): utils/dates → TypeScript (.mts); utils/ dir now TS (Phase 2) 2026-07-05 13:48:44 -05:00
money.mts style: apply Prettier across client + server (no behavior change) 2026-07-06 14:23:53 -05:00