xml_exception.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2012-2015 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. function print_exception(Throwable $e, \OCP\IL10N $l): void {
  8. p($e->getTraceAsString());
  9. if ($e->getPrevious() !== null) {
  10. print_unescaped('<s:previous-exception>');
  11. print_exception($e->getPrevious(), $l);
  12. print_unescaped('</s:previous-exception>');
  13. }
  14. }
  15. print_unescaped('<?xml version="1.0" encoding="utf-8"?>' . "\n");
  16. ?>
  17. <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  18. <s:exception><?php p($l->t('Internal Server Error')) ?></s:exception>
  19. <s:message>
  20. <?php p($l->t('The server was unable to complete your request.')) ?>
  21. <?php p($l->t('If this happens again, please send the technical details below to the server administrator.')) ?>
  22. <?php p($l->t('More details can be found in the server log.')) ?>
  23. <?php if (isset($_['serverLogsDocumentation']) && $_['serverLogsDocumentation'] !== ''): ?>
  24. <?php p($l->t('For more details see the documentation ↗.'))?>: <?php print_unescaped($_['serverLogsDocumentation']) ?>
  25. <?php endif; ?>
  26. </s:message>
  27. <s:technical-details>
  28. <s:remote-address><?php p($_['remoteAddr']) ?></s:remote-address>
  29. <s:request-id><?php p($_['requestID']) ?></s:request-id>
  30. <?php if (isset($_['debugMode']) && $_['debugMode'] === true): ?>
  31. <s:type><?php p($_['errorClass']) ?></s:type>
  32. <s:code><?php p($_['errorCode']) ?></s:code>
  33. <s:message><?php p($_['errorMsg']) ?></s:message>
  34. <s:file><?php p($_['file']) ?></s:file>
  35. <s:line><?php p($_['line']) ?></s:line>
  36. <s:stacktrace>
  37. <?php print_exception($_['exception'], $l); ?>
  38. </s:stacktrace>
  39. <?php endif; ?>
  40. </s:technical-details>
  41. </d:error>