management: the API has no error handler, so unauthenticated writes answer 500 instead of 401 #70
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by
Author59while fixing #59/#60 on PR #68, and byReviewer56r1during PR #56. Explicitly declared out of scope by issue #60, which named it as the reason overflow surfaced badly and asked for it to be filed separately.The defect
The Hono app mounted at
apps/management/app/api/[[...route]]/route.tshas no error handler, so any thrown error flattens to a bare 500 with no readable body. Two measured consequences:Why it was deferred, and why that was right
It touches every endpoint, so fixing it inside a field-validation PR would have made that PR unreviewable and would have widened a clean verdict's blast radius. #60 recorded the deferral honestly rather than describing the endpoints as safe — which is the distinction that matters: an inaccurate "this is fine" note stops the next reader from checking, whereas a named deferral invites it.
Scope
onErrorhandler to the Hono app that maps a thrown error to a status and a readable body, without leaking Postgres internals or stack traces to a caller.Related
createStockAdjustment, is filed separately and produces exactly this bare-500 shape when called outside a browser.apps/store/lib/catalog.tshas the mirror-image defect on the consumer side — a barecatchthat rewrites every throw into one friendly message, masking a Next static-generation bailout. Filed as #66. Worth reading together: one endpoint says nothing useful, one client refuses to hear anything specific.Verification
Acceptance
No endpoint answers a bare 500 for an anticipated condition; unauthenticated writes answer 401; no response body leaks driver internals or stack traces; PR #68's readable field-named rejections are unchanged.