diff options
Diffstat (limited to 'core/templates/exception.php')
-rw-r--r-- | core/templates/exception.php | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/core/templates/exception.php b/core/templates/exception.php index 9fd19d5a8b1..c8a26220092 100644 --- a/core/templates/exception.php +++ b/core/templates/exception.php @@ -1,8 +1,24 @@ <?php - /** @var array $_ */ - /** @var \OCP\IL10N $l */ +/** @var array $_ */ +/** @var \OCP\IL10N $l */ style('core', ['styles', 'header']); + +function print_exception(Throwable $e, \OCP\IL10N $l): void { + print_unescaped('<pre>'); + p($e->getTraceAsString()); + print_unescaped('</pre>'); + + if ($e->getPrevious() !== null) { + print_unescaped('<br />'); + print_unescaped('<h4>'); + p($l->t('Previous')); + print_unescaped('</h4>'); + + print_exception($e->getPrevious(), $l); + } +} + ?> <div class="error error-wide"> <h2><?php p($l->t('Internal Server Error')) ?></h2> @@ -26,6 +42,6 @@ style('core', ['styles', 'header']); <?php if (isset($_['debugMode']) && $_['debugMode'] === true): ?> <br /> <h3><?php p($l->t('Trace')) ?></h3> - <pre><?php p($_['trace']) ?></pre> + <?php print_exception($_['exception'], $l); ?> <?php endif; ?> </div> |