fix(api): correct Express route ordering and add try/catch to all project/chat handlers
POST /:projectId/documents/prepare was registered after the /:projectId/documents/:documentId wildcard route. Express matched the literal string "prepare" as :documentId, ran the copy-doc handler, and issued WHERE id = :id with value "prepare" against a uuid column, producing "operator does not exist: uuid = text". Fix: move prepare route registration before the :documentId wildcard in projects.ts. Also add try/catch to every async route handler in projects.ts and the GET / handler in chat.ts. Without these, an unhandled async rejection killed the Lambda process on the next invocation (Runtime.UnhandledPromiseRejection -> Runtime.ExitError), causing silent failures with no useful logs and making the route ordering bug very hard to diagnose.
| Repository | dropthejase/louis |
|---|---|
| Author | Jason Lee <12leeejk2@gmail.com> |
| Authored | |
| Parents | 6c104ea9 |
| Stats | 2 files changed , +628 , -555 |
| Part of | Try/catch coverage and Express route ordering across API Lambda |
Capture this commit into my fork
Download a Markdown prompt that tells Claude how to port this
exact commit into your working tree. Run it via
claude -p < capture-commit-478ee117.md
from inside the repo you want the change in.