Skip to content

Commit

Permalink
Changing ExceptionRenderer to use Debugger::formatTrace.
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Krämer committed Mar 24, 2015
1 parent 3419738 commit d4cb434
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/Error/ExceptionRenderer.php
Expand Up @@ -19,6 +19,7 @@
use Cake\Core\Configure;
use Cake\Core\Exception\Exception as CakeException;
use Cake\Core\Exception\MissingPluginException;
use Cake\Error\Debugger;
use Cake\Event\Event;
use Cake\Network\Exception\HttpException;
use Cake\Network\Request;
Expand Down Expand Up @@ -166,15 +167,10 @@ public function render()
'_serialize' => ['message', 'url', 'code']
];
if ($isDebug) {
$rawTrace = $exception->getTrace();
$trace = [];
foreach ($rawTrace as $line) {
if (isset($line['args'])) {
unset($line['args']);
}
$trace[] = $line;
}
$viewVars['trace'] = $trace;
$viewVars['trace'] = Debugger::formatTrace($exception->getTrace(), [
'format' => 'array',
'args' => false
]);
$viewVars['_serialize'][] = 'trace';
}
$this->controller->set($viewVars);
Expand Down

0 comments on commit d4cb434

Please sign in to comment.