1
0

exception.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /** @var array $_ */
  3. /** @var \OCP\IL10N $l */
  4. style('core', ['styles', 'header', 'exception']);
  5. function print_exception(Throwable $e, \OCP\IL10N $l): void {
  6. print_unescaped('<pre>');
  7. p($e->getTraceAsString());
  8. print_unescaped('</pre>');
  9. if ($e->getPrevious() !== null) {
  10. print_unescaped('<br />');
  11. print_unescaped('<h4>');
  12. p($l->t('Previous'));
  13. print_unescaped('</h4>');
  14. print_exception($e->getPrevious(), $l);
  15. }
  16. }
  17. ?>
  18. <div class="guest-box wide">
  19. <h2><?php p($l->t('Internal Server Error')) ?></h2>
  20. <p><?php p($l->t('The server was unable to complete your request.')) ?></p>
  21. <p><?php p($l->t('If this happens again, please send the technical details below to the server administrator.')) ?></p>
  22. <p><?php p($l->t('More details can be found in the server log.')) ?></p>
  23. <h3><?php p($l->t('Technical details')) ?></h3>
  24. <ul>
  25. <li><?php p($l->t('Remote Address: %s', [$_['remoteAddr']])) ?></li>
  26. <li><?php p($l->t('Request ID: %s', [$_['requestID']])) ?></li>
  27. <?php if (isset($_['debugMode']) && $_['debugMode'] === true): ?>
  28. <li><?php p($l->t('Type: %s', [$_['errorClass']])) ?></li>
  29. <li><?php p($l->t('Code: %s', [$_['errorCode']])) ?></li>
  30. <li><?php p($l->t('Message: %s', [$_['errorMsg']])) ?></li>
  31. <li><?php p($l->t('File: %s', [$_['file']])) ?></li>
  32. <li><?php p($l->t('Line: %s', [$_['line']])) ?></li>
  33. <?php endif; ?>
  34. </ul>
  35. <?php if (isset($_['debugMode']) && $_['debugMode'] === true): ?>
  36. <br />
  37. <h3><?php p($l->t('Trace')) ?></h3>
  38. <?php print_exception($_['exception'], $l); ?>
  39. <?php endif; ?>
  40. </div>