[CORE][CONTROLLER] Add TODO to Controller base class as to where our custom exception pages would be implemented

This commit is contained in:
Hugo Sales 2021-08-03 17:48:17 +00:00
parent 0b80727769
commit 51f8f004b3
Signed by untrusted user: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -39,6 +39,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\ControllerEvent;
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Symfony\Component\HttpKernel\Event\ViewEvent;
@ -123,6 +124,10 @@ class Controller extends AbstractController implements EventSubscriberInterface
public function onKernelException(ExceptionEvent $event)
{
$except = $event->getThrowable();
if ($_ENV['APP_ENV'] !== 'dev') {
// TODO: This is where our custom exception pages could go
// $event->setResponse((new Response())->setStatusCode(455));
}
do {
if ($except instanceof RedirectException) {
if (($redir = $except->redirect_response) != null) {