[BUG] Duplicate holiday returns 500 instead of 422 #28

Closed
opened 2026-02-20 02:31:27 +00:00 by santhoshj · 0 comments
Owner

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

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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: santhoshj/headroom#28