[BUG] Duplicate holiday returns 500 instead of 422 #28
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem: Adding a holiday on a date that already has a holiday returns HTTP 500 Internal Server Error.\n\nObserved:\n- Server throws UniqueConstraintViolationException which bubbles up as 500\n- Frontend shows generic 'Failed to add holiday' error\n\nExpected:\n- Return HTTP 422 Unprocessable Entity with clear error message\n- Apply graceful error handling pattern to all endpoints with unique constraints\n\nFix applied:\n- Catch UniqueConstraintViolationException in HolidayController and PtoController\n- Return 422 with structured error response