Files
twenty/packages
Sonarly Claude CodeandClaude Opus 4.6 ee73f8a087 fix: handle foreign key violations as 400 Bad Request instead of 500
Foreign key constraint violations (PostgreSQL error 23503) from user input
(e.g., POST /rest/people with a non-existent companyId) were falling through
to the generic PostgresException catch-all, which returned a 500 Internal
Server Error with an unhelpful "Data validation error." message.

Add a specific handler for FOREIGN_KEY_VIOLATION that returns a TwentyORMException
with INVALID_INPUT code, resulting in a 400 Bad Request with a descriptive message.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-20 00:34:28 +00:00
..
2026-02-18 23:34:36 +01:00
2026-02-19 21:14:57 +01:00
2026-02-18 23:34:36 +01:00