From 7f9780b5dfaf2df83990a4e95af9f4191f8ff50a Mon Sep 17 00:00:00 2001
From: Pascal Montoya
Date: Wed, 6 Jun 2018 10:34:52 +0200
Subject: [PATCH] Pass previous exception to FatalErrorException
---
.../Component/Debug/Exception/ClassNotFoundException.php | 3 +++
src/Symfony/Component/Debug/Exception/FatalErrorException.php | 4 ++--
.../Component/Debug/Exception/UndefinedFunctionException.php | 3 +++
.../Component/Debug/Exception/UndefinedMethodException.php | 3 +++
4 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/Symfony/Component/Debug/Exception/ClassNotFoundException.php b/src/Symfony/Component/Debug/Exception/ClassNotFoundException.php
index b91bf46631..de5c456443 100644
--- a/src/Symfony/Component/Debug/Exception/ClassNotFoundException.php
+++ b/src/Symfony/Component/Debug/Exception/ClassNotFoundException.php
@@ -26,6 +26,9 @@ class ClassNotFoundException extends FatalErrorException
$previous->getSeverity(),
$previous->getFile(),
$previous->getLine(),
+ null,
+ true,
+ null,
$previous->getPrevious()
);
$this->setTrace($previous->getTrace());
diff --git a/src/Symfony/Component/Debug/Exception/FatalErrorException.php b/src/Symfony/Component/Debug/Exception/FatalErrorException.php
index db2fb43bbc..3fd7c45fdb 100644
--- a/src/Symfony/Component/Debug/Exception/FatalErrorException.php
+++ b/src/Symfony/Component/Debug/Exception/FatalErrorException.php
@@ -35,9 +35,9 @@ use Symfony\Component\HttpKernel\Exception\FatalErrorException as LegacyFatalErr
*/
class FatalErrorException extends LegacyFatalErrorException
{
- public function __construct($message, $code, $severity, $filename, $lineno, $traceOffset = null, $traceArgs = true, array $trace = null)
+ public function __construct($message, $code, $severity, $filename, $lineno, $traceOffset = null, $traceArgs = true, array $trace = null, $previous = null)
{
- parent::__construct($message, $code, $severity, $filename, $lineno);
+ parent::__construct($message, $code, $severity, $filename, $lineno, $previous);
if (null !== $trace) {
if (!$traceArgs) {
diff --git a/src/Symfony/Component/Debug/Exception/UndefinedFunctionException.php b/src/Symfony/Component/Debug/Exception/UndefinedFunctionException.php
index a66ae2a387..8f5f454e55 100644
--- a/src/Symfony/Component/Debug/Exception/UndefinedFunctionException.php
+++ b/src/Symfony/Component/Debug/Exception/UndefinedFunctionException.php
@@ -26,6 +26,9 @@ class UndefinedFunctionException extends FatalErrorException
$previous->getSeverity(),
$previous->getFile(),
$previous->getLine(),
+ null,
+ true,
+ null,
$previous->getPrevious()
);
$this->setTrace($previous->getTrace());
diff --git a/src/Symfony/Component/Debug/Exception/UndefinedMethodException.php b/src/Symfony/Component/Debug/Exception/UndefinedMethodException.php
index 350dc3187f..f7e340baf4 100644
--- a/src/Symfony/Component/Debug/Exception/UndefinedMethodException.php
+++ b/src/Symfony/Component/Debug/Exception/UndefinedMethodException.php
@@ -26,6 +26,9 @@ class UndefinedMethodException extends FatalErrorException
$previous->getSeverity(),
$previous->getFile(),
$previous->getLine(),
+ null,
+ true,
+ null,
$previous->getPrevious()
);
$this->setTrace($previous->getTrace());