This commit is contained in:
22
src/test.php
Normal file
22
src/test.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
|
||||
use Symfony\Component\HttpKernel\KernelEvents;
|
||||
|
||||
class test implements EventSubscriberInterface
|
||||
{
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return [KernelEvents::EXCEPTION => 'onKernelException'];
|
||||
}
|
||||
|
||||
public function onKernelException(ExceptionEvent $event)
|
||||
{
|
||||
$event->setResponse(new Response('test'));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user