Skip to content

Commit 8b22526

Browse files
minor symfony#14369 [HttpKernel] Cleanup ExceptionListener (nicolas-grekas)
This PR was merged into the 2.3 branch. Discussion ---------- [HttpKernel] Cleanup ExceptionListener | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- d97279e [HttpKernel] Cleanup ExceptionListener
2 parents 7cdd624 + d97279e commit 8b22526

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ public function __construct($controller, LoggerInterface $logger = null)
3838

3939
public function onKernelException(GetResponseForExceptionEvent $event)
4040
{
41-
static $handling;
42-
43-
if (true === $handling) {
44-
return false;
45-
}
46-
47-
$handling = true;
48-
4941
$exception = $event->getException();
5042
$request = $event->getRequest();
5143

@@ -65,13 +57,10 @@ public function onKernelException(GetResponseForExceptionEvent $event)
6557
$request->setMethod('GET');
6658

6759
try {
68-
$response = $event->getKernel()->handle($request, HttpKernelInterface::SUB_REQUEST, true);
60+
$response = $event->getKernel()->handle($request, HttpKernelInterface::SUB_REQUEST, false);
6961
} catch (\Exception $e) {
7062
$this->logException($e, sprintf('Exception thrown when handling an exception (%s: %s at %s line %s)', get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()), false);
7163

72-
// set handling to false otherwise it wont be able to handle further more
73-
$handling = false;
74-
7564
$wrapper = $e;
7665

7766
while ($prev = $wrapper->getPrevious()) {
@@ -88,8 +77,6 @@ public function onKernelException(GetResponseForExceptionEvent $event)
8877
}
8978

9079
$event->setResponse($response);
91-
92-
$handling = false;
9380
}
9481

9582
public static function getSubscribedEvents()

0 commit comments

Comments
 (0)