/error/error: show the whole exception chain
This commit is contained in:
parent
0abff5f643
commit
c650e5c1e3
|
@ -86,9 +86,22 @@ class ErrorController extends ActionController
|
||||||
Logger::error("%s\n%s", $exception, $exception->getTraceAsString());
|
Logger::error("%s\n%s", $exception, $exception->getTraceAsString());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$this->view->message = $exception->getMessage();
|
|
||||||
|
$this->view->messages = array();
|
||||||
|
|
||||||
if ($this->getInvokeArg('displayExceptions')) {
|
if ($this->getInvokeArg('displayExceptions')) {
|
||||||
$this->view->stackTrace = $exception->getTraceAsString();
|
$this->view->stackTraces = array();
|
||||||
|
|
||||||
|
do {
|
||||||
|
$this->view->messages[] = $exception->getMessage();
|
||||||
|
$this->view->stackTraces[] = $exception->getTraceAsString();
|
||||||
|
$exception = $exception->getPrevious();
|
||||||
|
} while ($exception !== null);
|
||||||
|
} else {
|
||||||
|
do {
|
||||||
|
$this->view->messages[] = $exception->getMessage();
|
||||||
|
$exception = $exception->getPrevious();
|
||||||
|
} while ($exception !== null);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -4,9 +4,17 @@
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p tabindex="-1" class="autofocus error-message"><?= nl2br($this->escape($message)) ?></p>
|
<?php
|
||||||
<?php if (isset($stackTrace)): ?>
|
if (isset($stackTraces)) {
|
||||||
<hr>
|
foreach ($messages as $i => $message) {
|
||||||
<pre><?= $this->escape($stackTrace) ?></pre>
|
echo '<p tabindex="-1" class="autofocus error-message">' . nl2br($this->escape($message)) . '</p>'
|
||||||
<?php endif ?>
|
. '<hr>'
|
||||||
|
. '<pre>' . $this->escape($stackTraces[$i]) . '</pre>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
foreach ($messages as $message) {
|
||||||
|
echo '<p tabindex="-1" class="autofocus error-message">' . nl2br($this->escape($message)) . '</p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue