Skip to content

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

Merged
soyuka merged 1 commit into
api-platform:mainfrom
Amoifr:feat-8405-unique-constraint-422
Sep 1, 2026
Merged

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

Conversation

@Amoifr

@Amoifr Amoifr commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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").

@VincentLanglet
VincentLanglet requested a review from soyuka August 31, 2026 17:00
@soyuka
soyuka merged commit 672d48e into api-platform:main Sep 1, 2026
3 of 111 checks passed
@soyuka

soyuka commented Sep 1, 2026

Copy link
Copy Markdown
Member

thanks!

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.

3 participants