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 b91bf46631bbb..de5c45644363b 100644
--- a/src/Symfony/Component/Debug/Exception/ClassNotFoundException.php
+++ b/src/Symfony/Component/Debug/Exception/ClassNotFoundException.php
@@ -26,6 +26,9 @@ public function __construct($message, \ErrorException $previous)
$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 db2fb43bbceb5..3fd7c45fdbf95 100644
--- a/src/Symfony/Component/Debug/Exception/FatalErrorException.php
+++ b/src/Symfony/Component/Debug/Exception/FatalErrorException.php
@@ -35,9 +35,9 @@ class FatalErrorException extends \ErrorException
*/
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 a66ae2a3879c9..8f5f454e55d99 100644
--- a/src/Symfony/Component/Debug/Exception/UndefinedFunctionException.php
+++ b/src/Symfony/Component/Debug/Exception/UndefinedFunctionException.php
@@ -26,6 +26,9 @@ public function __construct($message, \ErrorException $previous)
$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 350dc3187f475..f7e340baf4dc6 100644
--- a/src/Symfony/Component/Debug/Exception/UndefinedMethodException.php
+++ b/src/Symfony/Component/Debug/Exception/UndefinedMethodException.php
@@ -26,6 +26,9 @@ public function __construct($message, \ErrorException $previous)
$previous->getSeverity(),
$previous->getFile(),
$previous->getLine(),
+ null,
+ true,
+ null,
$previous->getPrevious()
);
$this->setTrace($previous->getTrace());