Skip to content

fix(routes): return 4xx instead of 500 for size, cursor and archived errors - #36

Merged
TheGreatAxios merged 1 commit into
cl-9400-artifacts-align-repo-scaffolding-with-the-package-standardfrom
cl-9430-artifacts-return-4xx-instead-of-500-for-size-cursor-and
Sep 27, 2026
Merged

TheGreatAxios merged 1 commit into
cl-9400-artifacts-align-repo-scaffolding-with-the-package-standardfrom
cl-9430-artifacts-return-4xx-instead-of-500-for-size-cursor-and

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • POST /artifacts/upload maps ArtifactSizeError to 400, as POST /artifacts does, so a filename over 512 characters no longer 500s.
  • The list cursor accepts only the YYYY-MM-DDTHH:MM:SS.ffffffZ__id shape the API emits, and rejects dates that Date.parse rolls over but Postgres refuses (for example Feb 30). Those are 400 instead of 500.
  • The workflow routes POST /artifacts and PATCH /artifacts/:id map ArtifactNotFoundError (including an archived artifact) to 404 and ArtifactSizeError to 400.
  • Stacked on chore: align repo scaffolding with the package standard #35.

Verification

  • bun run check, bun run build: pass.
  • bun run test:coverage against local Postgres: 297 pass, 0 fail. The four new tests fail without the fix.

Closes CL-9430

…errors

An upload filename over the title limit is 400. A list cursor must be
the updatedAt__id shape the API emits, so a date Postgres would refuse
is 400. The workflow routes map ArtifactNotFoundError to 404 and
ArtifactSizeError to 400.
@TheGreatAxios
TheGreatAxios added this pull request to stack #32 September 27, 2026 00:38
@TheGreatAxios
TheGreatAxios merged commit 6deaaee into main Sep 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant