961ca04a403e0f409664313edce2df14eeb46d78
No code anywhere caught Prisma's P2002 (unique constraint violation). Colony/apiary/queen codes, product SKUs, batch numbers, and equipment inventory numbers are all @unique DB columns with no application-level duplicate check ahead of the insert, relying on the constraint itself - so a beekeeper reusing a code by mistake got a bare 500 "Internal server error" with zero indication what went wrong, and the incident polluted server logs as a fake error rather than a routine 4xx. AllExceptionsFilter now recognizes P2002, returns 409 with a specific German message naming the conflicting field when it's a single known column (falling back to a generic duplicate message otherwise), and logs it at warn level like any other client-side rejection. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Description
ApiCore - Imkereidokumentationssoftware
https://apicore.encry.de/
7.6 MiB
0 Stars
1 Watchers
0 Forks
Languages
TypeScript
98.5%
JavaScript
0.8%
Python
0.3%
CSS
0.2%
PLpgSQL
0.1%