exception.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. <?php if (isset($_['serverLogsDocumentation']) && $_['serverLogsDocumentation'] !== ''): ?>
  24. <p><a href="<?php print_unescaped($_['serverLogsDocumentation']) ?>" target="_blank" rel="noopener"><?php p($l->t('For more details see the documentation ↗.')) ?></a></p>
  25. <?php endif; ?>
  26. <h3><?php p($l->t('Technical details')) ?></h3>
  27. <ul>
  28. <li><?php p($l->t('Remote Address: %s', [$_['remoteAddr']])) ?></li>
  29. <li><?php p($l->t('Request ID: %s', [$_['requestID']])) ?></li>
  30. <?php if (isset($_['debugMode']) && $_['debugMode'] === true): ?>
  31. <li><?php p($l->t('Type: %s', [$_['errorClass']])) ?></li>
  32. <li><?php p($l->t('Code: %s', [$_['errorCode']])) ?></li>
  33. <li><?php p($l->t('Message: %s', [$_['errorMsg']])) ?></li>
  34. <li><?php p($l->t('File: %s', [$_['file']])) ?></li>
  35. <li><?php p($l->t('Line: %s', [$_['line']])) ?></li>
  36. <?php endif; ?>
  37. </ul>
  38. <?php if (isset($_['debugMode']) && $_['debugMode'] === true): ?>
  39. <br />
  40. <h3><?php p($l->t('Trace')) ?></h3>
  41. <?php print_exception($_['exception'], $l); ?>
  42. <?php endif; ?>
  43. </div>