Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3fa1ad9

Browse files
[Console] Fix restoring exception handler
1 parent 7625c77 commit 3fa1ad9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Console/Application.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,12 @@ public function run(InputInterface $input = null, OutputInterface $output = null
163163
$exitCode = 1;
164164
}
165165
} finally {
166+
// if the exception handler changed, keep it
167+
// otherwise, unregister $renderException
166168
if (!$phpHandler) {
169+
if (set_exception_handler($renderException) === $renderException) {
170+
restore_exception_handler();
171+
}
167172
restore_exception_handler();
168173
} elseif (!$debugHandler) {
169174
$phpHandler[0]->setExceptionHandler(null);

0 commit comments

Comments
 (0)