Skip to content

Commit

Permalink
bug #27514 [Debug] Pass previous exception to FatalErrorException (pm…
Browse files Browse the repository at this point in the history
…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 ae30a80
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Expand Up @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Debug/Exception/FatalErrorException.php
Expand Up @@ -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) {
Expand Down
Expand Up @@ -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());
Expand Down
Expand Up @@ -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());
Expand Down

0 comments on commit ae30a80

Please sign in to comment.