Commit 4091be76 authored by Fabien Potencier's avatar Fabien Potencier

simplified some code

parent 34dbfea8
...@@ -14,7 +14,6 @@ namespace Silex; ...@@ -14,7 +14,6 @@ namespace Silex;
use Silex\Application; use Silex\Application;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Debug\ExceptionHandler as DebugExceptionHandler; use Symfony\Component\HttpKernel\Debug\ExceptionHandler as DebugExceptionHandler;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
...@@ -37,7 +36,7 @@ class ExceptionHandler implements EventSubscriberInterface ...@@ -37,7 +36,7 @@ class ExceptionHandler implements EventSubscriberInterface
$response = new Response($handler->getErrorMessage($exception), $code); $response = new Response($handler->getErrorMessage($exception), $code);
} else { } else {
$title = 'Whoops, looks like something went wrong.'; $title = 'Whoops, looks like something went wrong.';
if ($exception instanceof NotFoundHttpException) { if (404 == $code) {
$title = 'Sorry, the page you are looking for could not be found.'; $title = 'Sorry, the page you are looking for could not be found.';
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment