In my Symfony2 project I\'m getting at development mode correct 404 Exception screen. But I\'m getting blank screen with HTTP status code 500 instead of 404 at production mo
I had the same issue,
But my isGranted was in the php side. So I added a token check :
Before :
if ($this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')
After :
if ($this->get('security.token_storage')->getToken() && $this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')