Skip to content

Commit

Permalink
[ExceptionRender] - Not showing stack trace #65
Browse files Browse the repository at this point in the history
  • Loading branch information
cnizzardini committed Jun 26, 2021
1 parent eb07cf7 commit fd59d63
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions plugins/exception-render/src/MixerApiExceptionRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,24 @@ public function getError(): Throwable
*/
private function debugViewVars($exception, array $viewVars): array
{
if (!Configure::read('debug') || !$exception instanceof CakeException) {
if (!Configure::read('debug')) {
return $viewVars;
}

$trace = (array)Debugger::formatTrace($exception->getTrace(), [
'format' => 'array',
'args' => false,
]);
$trace = (array)Debugger::formatTrace(
$exception->getTrace(),
[
'format' => 'array',
'args' => false,
]
);

$origin = [
'file' => $exception->getFile() ?: 'null',
'line' => $exception->getLine() ?: 'null',
];

// Traces don't include the origin file/line.
// traces don't include the origin file/line.
array_unshift($trace, $origin);
$viewVars['trace'] = $trace;
$viewVars += $origin;
Expand Down

0 comments on commit fd59d63

Please sign in to comment.