Description
Hi @soyuka, I hope you're going well.
I just tried to use exception_to_status and had two suggestions. I wanted to get your opinion about it.
First, I find not friendly the fact we have to copy the defaut from ApiPlatform when we want to add an extra exception.
It implies:
- that we know the default value
- that if ApiPlatform add an extra value we update our config (or do not enjoy the default values)
I wonder if a better pattern for the option could be interesting.
Like adding another option exception_to_status_strategy: override/merge. To decide if we want to merge or override with the default value.
Secondly the context in which I wanted to add exception_to_status to the config was for
Doctrine\DBAL\Exception\UniqueConstraintViolationException
This could be consider as a 409 (I think ? Or a 422) ? Rather a 500.
In the same way OptimisticLockException is already mapped to a 409. WDYT ?
Description
Hi @soyuka, I hope you're going well.
I just tried to use
exception_to_statusand had two suggestions. I wanted to get your opinion about it.First, I find not friendly the fact we have to copy the defaut from ApiPlatform when we want to add an extra exception.
It implies:
I wonder if a better pattern for the option could be interesting.
Like adding another option
exception_to_status_strategy: override/merge. To decide if we want to merge or override with the default value.Secondly the context in which I wanted to add
exception_to_statusto the config was forThis could be consider as a 409 (I think ? Or a 422) ? Rather a 500.
In the same way
OptimisticLockExceptionis already mapped to a 409. WDYT ?