Permalink
Browse files

bug #27514 [Debug] Pass previous exception to FatalErrorException (pm…

…ontoya)

This PR was merged into the 2.8 branch.

Discussion
----------

[Debug] Pass previous exception to FatalErrorException

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27483
| License       | MIT

Add a previous parameter to FatalErrorException.
Call \ErrorException with this parameter.
Update parent::__constructor for inherited classes with default parameters and the new one

Commits
-------

7f9780b Pass previous exception to FatalErrorException
  • Loading branch information...
fabpot committed Jun 6, 2018
2 parents 7d2d60f + 7f9780b commit ae30a80f770098f0e9bc0e38f07e464b93b838c8
@@ -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());
@@ -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) {
@@ -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());
@@ -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());

0 comments on commit ae30a80

Please sign in to comment.