src/Towel/Controller/BaseController.php
public function routeError(\Exception $e)
    {
        if ($e instanceof NotFoundHttpException) {
            $responseContent = $this->twig()->render('Default\404.twig');
            $response = new Response($responseContent, 404);
        } else {
            $responseContent = $this->twig()->render('Default\500.twig', array('error' => $e->getMessage()));
            $response = new Response($responseContent, 500);
        }

        return $response;
    }
public function routeError(\Exception $e)
    {
        if ($e instanceof NotFoundHttpException) {
            $responseContent = $this->twig()->render('Default\404.twig');
            $response = new Response($responseContent, 404);
        } else {
            $responseContent = $this->twig()->render('Default\500.twig', array('error' => $e->getMessage()));
            $response = new Response($responseContent, 500);
        }

        return $response;
    }
public function routeError ( \ Exception $ e ) { if ( $ e instanceof NotFoundHttpException ) { $ responseContent = $ this -> twig ( ) -> render ( 'Default\404.twig' ) ; $ response = new Response ( $ responseContent , 404 ) ; } else { $ responseContent = $ this -> twig ( ) -> render ( 'Default\500.twig' , array ( 'error' => $ e -> getMessage ( ) ) ) ; $ response = new Response ( $ responseContent , 500 ) ; } return $ response ; }
404 and 500 error page for non debug mode

@param \Exception $e

@return Response
404 and 500 error page for non debug mode