Skip to content

Commit

Permalink
CLI renderer should use inner exception for PHP7ErrorException instan…
Browse files Browse the repository at this point in the history
…ces to keep original stacktrace
  • Loading branch information
jippi committed Aug 4, 2016
1 parent 4ff1c3e commit 3213081
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Console/ConsoleErrorHandler.php
Expand Up @@ -16,6 +16,7 @@

use Cake\Error\BaseErrorHandler;
use Cake\Error\FatalErrorException;
use Cake\Error\PHP7ErrorException;
use Exception;

/**
Expand Down Expand Up @@ -83,6 +84,11 @@ protected function _displayException($exception)
if ($exception instanceof FatalErrorException) {
$errorName = 'Fatal Error:';
}

if ($exception instanceof PHP7ErrorException) {
$exception = $exception->getError();
}

$message = sprintf(
"<error>%s</error> %s in [%s, line %s]",
$errorName,
Expand Down

0 comments on commit 3213081

Please sign in to comment.