File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ to it::
2727 $argumentResolver = new HttpKernel\Controller\ArgumentResolver();
2828
2929 $dispatcher = new EventDispatcher();
30- $dispatcher->addSubscriber(new HttpKernel\EventListener\ExceptionListener (
30+ $dispatcher->addSubscriber(new HttpKernel\EventListener\ErrorListener (
3131 'Calendar\Controller\ErrorController::exception'
3232 ));
3333 $dispatcher->addSubscriber(new HttpKernel\EventListener\RouterListener($matcher, $requestStack));
@@ -124,7 +124,7 @@ Create a new file to host the dependency injection container configuration::
124124 $containerBuilder->register('listener.response', HttpKernel\EventListener\ResponseListener::class)
125125 ->setArguments(['UTF-8'])
126126 ;
127- $containerBuilder->register('listener.exception', HttpKernel\EventListener\ExceptionListener ::class)
127+ $containerBuilder->register('listener.exception', HttpKernel\EventListener\ErrorListener ::class)
128128 ->setArguments(['Calendar\Controller\ErrorController::exception'])
129129 ;
130130 $containerBuilder->register('dispatcher', EventDispatcher\EventDispatcher::class)
Original file line number Diff line number Diff line change @@ -66,22 +66,22 @@ framework: it matches the incoming request and populates the request
6666attributes with route parameters.
6767
6868Our code is now much more concise and surprisingly more robust and more
69- powerful than ever. For instance, use the built-in ``ExceptionListener `` to
69+ powerful than ever. For instance, use the built-in ``ErrorListener `` to
7070make your error management configurable::
7171
7272 $errorHandler = function (Symfony\Component\ErrorHandler\Exception\FlattenException $exception) {
7373 $msg = 'Something went wrong! ('.$exception->getMessage().')';
7474
7575 return new Response($msg, $exception->getStatusCode());
7676 };
77- $dispatcher->addSubscriber(new HttpKernel\EventListener\ExceptionListener ($errorHandler));
77+ $dispatcher->addSubscriber(new HttpKernel\EventListener\ErrorListener ($errorHandler));
7878
79- ``ExceptionListener `` gives you a ``FlattenException `` instance instead of the
79+ ``ErrorListener `` gives you a ``FlattenException `` instance instead of the
8080thrown ``Exception `` or ``Error `` instance to ease exception manipulation and
8181display. It can take any valid controller as an exception handler, so you can
8282create an ErrorController class instead of using a Closure::
8383
84- $listener = new HttpKernel\EventListener\ExceptionListener (
84+ $listener = new HttpKernel\EventListener\ErrorListener (
8585 'Calendar\Controller\ErrorController::exception'
8686 );
8787 $dispatcher->addSubscriber($listener);
You can’t perform that action at this time.
0 commit comments