Merge pull request #3293 from Icinga/bugfix/exception-chain-hidden
/error/error: show the whole exception chain
This commit is contained in:
commit
2080290409
|
@ -86,9 +86,22 @@ class ErrorController extends ActionController
|
|||
Logger::error("%s\n%s", $exception, $exception->getTraceAsString());
|
||||
break;
|
||||
}
|
||||
$this->view->message = $exception->getMessage();
|
||||
|
||||
$this->view->messages = array();
|
||||
|
||||
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;
|
||||
|
|
|
@ -4,9 +4,17 @@
|
|||
</div>
|
||||
<?php endif ?>
|
||||
<div class="content">
|
||||
<p tabindex="-1" class="autofocus error-message"><?= nl2br($this->escape($message)) ?></p>
|
||||
<?php if (isset($stackTrace)): ?>
|
||||
<hr>
|
||||
<pre><?= $this->escape($stackTrace) ?></pre>
|
||||
<?php endif ?>
|
||||
<?php
|
||||
if (isset($stackTraces)) {
|
||||
foreach ($messages as $i => $message) {
|
||||
echo '<p tabindex="-1" class="autofocus error-message">' . nl2br($this->escape($message)) . '</p>'
|
||||
. '<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>
|
||||
|
|
Loading…
Reference in New Issue