Skip to content

Handle async validation errors#1895

Open
sodalone wants to merge 1 commit into
SecureBananaLabs:mainfrom
sodalone:codex/handle-async-validation-errors
Open

Handle async validation errors#1895
sodalone wants to merge 1 commit into
SecureBananaLabs:mainfrom
sodalone:codex/handle-async-validation-errors

Conversation

@sodalone

Copy link
Copy Markdown

Summary

  • add an async route wrapper so rejected async controller promises reach Express error middleware
  • return structured 400 JSON responses for Zod validation errors
  • add regression coverage for invalid /api/jobs payloads so the request returns validation errors instead of hanging

Validation

  • node --test apps\api\src\tests\*.test.js passes
  • git diff --check passes

Note: root npm test is fixed separately in #1892; this branch was verified with the direct Node test command above to avoid mixing the two scoped fixes.

Fixes #1893
/claim #743

@sodalone

Copy link
Copy Markdown
Author

Validation transcript from this branch:

$ node --test apps\api\src\tests\*.test.js
pass 8
fail 0

$ git diff --check
(no output)

Coverage note: the new regression test posts an invalid job payload and asserts the API returns HTTP 400 instead of leaving the request unresolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Async controller validation errors hang API requests

1 participant