Const401 (route-handler.ts:26-30).
403 (route-handler.ts:32-36); resource becomes the instance.
401 (route-handler.ts:38-39); the key reason is the detail.
400 (route-handler.ts:41-45); details → errors.
404 (route-handler.ts:47-51); detail is ${resource} not found, id → instance.
409 (route-handler.ts:53-54).
402 (route-handler.ts:56-57); optional Stripe-style code → errors.
400 (route-handler.ts:59-60); the discount code → errors, reason → detail.
502 (route-handler.ts:62-67); GENERIC wire detail, cause logged only.
429 (route-handler.ts:69-78); retryAfterMs drives the Retry-After header.
500 (route-handler.ts:80-85); GENERIC wire detail, cause logged only.
Factory helpers mirroring saastarter's TaggedError set (errors.ts) with the SAME field semantics the route-handler rendered (route-handler.ts:24-86).
externalService/internalkeep their detail GENERIC on the wire and stash the cause inlogContext(route-handler.ts:63,81 log it server-side, never leak it).