Hello All,
It would be great to let the user mapping Status Codes to any exceptions. it will avoid writing "unnecessary" code to catch and rethrow exception
This feature is already implemented on FosRest
http://symfony.com/doc/master/bundles/FOSRestBundle/4-exception-controller-support.html
# app/config/config.yml
fos_rest:
exception:
codes:
'Symfony\Component\Routing\Exception\ResourceNotFoundException': 404
'Doctrine\ORM\OptimisticLockException': HTTP_CONFLICT
messages:
'Acme\HelloBundle\Exception\MyExceptionWithASafeMessage': true
What do you think ?
Hello All,
It would be great to let the user mapping Status Codes to any exceptions. it will avoid writing "unnecessary" code to catch and rethrow exception
This feature is already implemented on FosRest
http://symfony.com/doc/master/bundles/FOSRestBundle/4-exception-controller-support.html
What do you think ?