Skip to content

service: generated by-id handler returns 500 {defined:false} for a missing row instead of a defined 404 #1263

Description

@rickylabs

Found during the #1250 composed verification (live scaffold at PR #1256's head, users service on its assigned port). With an empty users table:

GET /api/users/1 → 500 {"defined":false,"code":"INTERNAL_SERVER_ERROR","status":500,"message":"User 1 not found"}
GET /api/users/abc → 400 (validation — correct)
GET /api/users?page=1&limit=5 → 200 (coercion — correct post-#1250)

The handler's not-found throw is not a defined oRPC error, so it surfaces as a 500. The docs-page default request for the by-id GET therefore errors on any fresh project (compounded by the seed being a no-op — filed separately).

Acceptance

  • Generated by-id/update/delete handlers throw a defined NOT_FOUND (404) for missing rows
  • The OpenAPI projection documents the 404 for those operations
  • A scaffold-level test covers missing-row → 404 (not 500) for each generated by-id operation

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions