public function onKernelException(GetResponseForExceptionEvent $event)
    {
        $exception = $event->getException();
        
        if ($exception instanceof NotFoundHttpException) {
            $response = $event->getResponse();

            $values = array(
                'status_code' => 404,
                'message' => $exception->getMessage(),
            );
            
            $event->setResponse($this->templating->renderResponse('AlphaLemonThemeEngineBundle:Error:error.html.twig', $values, $response));
        }
    }
public function onKernelException(GetResponseForExceptionEvent $event)
    {
        $exception = $event->getException();
        
        if ($exception instanceof NotFoundHttpException) {
            $response = $event->getResponse();

            $values = array(
                'status_code' => 404,
                'message' => $exception->getMessage(),
            );
            
            $event->setResponse($this->templating->renderResponse('AlphaLemonThemeEngineBundle:Error:error.html.twig', $values, $response));
        }
    }
public function onKernelException ( GetResponseForExceptionEvent $ event ) { $ exception = $ event -> getException ( ) ; if ( $ exception instanceof NotFoundHttpException ) { $ response = $ event -> getResponse ( ) ; $ values = array ( 'status_code' => 404 , 'message' => $ exception -> getMessage ( ) , ) ; $ event -> setResponse ( $ this -> templating -> renderResponse ( 'AlphaLemonThemeEngineBundle:Error:error.html.twig' , $ values , $ response ) ) ; } }
Returns a custom error page for 404 errors

@param GetResponseForExceptionEvent $event
Returns a custom error page for 404 errors