1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-06-20 09:49:48 +02:00

Add stack trace to exceptions (#397)

This commit is contained in:
Jonathanm10
2018-11-12 15:09:41 +01:00
committed by Barry vd. Heuvel
parent b49e46a266
commit 3169ed558d
2 changed files with 8 additions and 0 deletions

View File

@ -108,6 +108,7 @@ class ExceptionsCollector extends DataCollector implements Renderable
'code' => $e->getCode(),
'file' => $filePath,
'line' => $e->getLine(),
'stack_trace' => $e->getTraceAsString(),
'surrounding_lines' => $lines,
'xdebug_link' => $this->getXdebugLink($filePath, $e->getLine())
);

View File

@ -558,6 +558,13 @@ if (typeof(PhpDebugBar) == 'undefined') {
}
});
}
if (e.stack_trace) {
e.stack_trace.split("\n").forEach(function(trace) {
var $traceLine = $('<div />');
$('<span />').addClass(csscls('filename')).text(trace).appendTo($traceLine);
$traceLine.appendTo(li);
});
}
}});
this.$list.$el.appendTo(this.$el);