Skip to content

feat(symfony): map UniqueConstraintViolationException to 422 by default - #8478

Open
Amoifr wants to merge 1 commit into
api-platform:mainfrom
Amoifr:feat-8405-unique-constraint-422
Open

feat(symfony): map UniqueConstraintViolationException to 422 by default#8478
Amoifr wants to merge 1 commit into
api-platform:mainfrom
Amoifr:feat-8405-unique-constraint-422

Conversation

@Amoifr

@Amoifr Amoifr commented Aug 24, 2026

Copy link
Copy Markdown

Follow-up to the second point of #8405, where @soyuka concluded "Probably just a 422": Doctrine\DBAL\Exception\UniqueConstraintViolationException is now mapped to 422 in the default exception_to_status, next to the existing OptimisticLockException => 409. Referencing the class stays safe when the DBAL is not installed, like the existing OptimisticLockException entry (::class does not load the class).

The first point of the issue (merging user config with the defaults) is left out, per the same comment ("we won't change the behavior").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant