Skip to content

Commit

Permalink
Fixed ErrorHander->renderBacktrace()
Browse files Browse the repository at this point in the history
  • Loading branch information
bfanger committed Aug 13, 2018
1 parent 0e81ab4 commit a1cfc2b
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/Debug/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,12 @@ private function render($type, $message = null, $information = null)
if ($type == E_ERROR) {
echo 'Uncaught ';
}
echo get_class($exception);
$class = get_class($exception);
if (strpos($class, '\\') === false) {
echo $class;
} else {
echo '<abbr title="'.$class.'">'.basename(str_replace('\\', '/', $class)).'</abbr>';
}
} else {
echo $this->error_types[$type];
}
Expand All @@ -406,7 +411,7 @@ private function render($type, $message = null, $information = null)
$this->renderBrowserInfo();
$this->renderServerInfo();
}
$this->renderBacktrace($exception);
$this->renderBacktrace();
switch ($type) {
case E_WARNING:
case E_USER_ERROR:
Expand Down Expand Up @@ -577,21 +582,17 @@ private function resolveLocation()
/**
* De bestanden, regelnummers, functie en objectnamen waar de fout optrad weergeven.
*/
private function renderBacktrace($exception)
private function renderBacktrace()
{
if (self::isThrowable($exception)) {
$backtrace= $exception->getTrace();
} else {
$backtrace = debug_backtrace();
}
$backtrace = debug_backtrace();
echo "<b>Backtrace</b><div>\n";
// Pass 1:
// Backtrace binnen de errorhandler niet tonen
// Bij een Exception de $Exception->getTrace() tonen.
// De plaats van de errror extra benadrukken (door een extra witregel)
$helperPath = dirname(dirname(__DIR__)).'/helpers.php';
while ($call = next($backtrace)) {
if (isset($call['object']) && $call['object'] === $this) {
if (isset($call['class']) && $call['class'] === self::class) {
if ($call['function'] == 'errorCallback') { // Is de fout getriggerd door php
if (isset($call['file'])) { // Zit de fout niet in een functie?
$this->renderBacktraceCall($call, true); // Dan is de fout afkomsting van deze $call, maar verberg de ErrorHandler->errorCallback parameters
Expand Down

0 comments on commit a1cfc2b

Please sign in to comment.