Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use do-while
  • Loading branch information
enumag committed Feb 21, 2019
1 parent c47cd70 commit 015da50
Showing 1 changed file with 3 additions and 8 deletions.
Expand Up @@ -56,17 +56,12 @@ public function onKernelException(GetResponseForExceptionEvent $event)
} catch (\Exception $e) {
$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()));

if ($exception === $e) {
throw $e;
}

$wrapper = $e;

while ($prev = $wrapper->getPrevious()) {
$prev = $e;
do {
if ($exception === $wrapper = $prev) {
throw $e;
}
}
} while ($prev = $wrapper->getPrevious());

$prev = new \ReflectionProperty($wrapper instanceof \Exception ? \Exception::class : \Error::class, 'previous');
$prev->setAccessible(true);
Expand Down

0 comments on commit 015da50

Please sign in to comment.