- Symfony 3.4
- PHP 7.4
I am trying to map
Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException
to another response code. Basically like Laravel did: https://github.com/laravel/framework/pull/29000/files
Currently it creates a fatal error and 500 response:
PHP Fatal error: Uncaught Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException: ...
I want to return a 404
as response.
If you want to do like in Laravel, you should take a look at Event Listener.