print_exception.php 525 B

123456789101112131415161718192021
  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. print_unescaped('<pre>');
  9. p($e->getTraceAsString());
  10. print_unescaped('</pre>');
  11. if ($e->getPrevious() !== null) {
  12. print_unescaped('<br />');
  13. print_unescaped('<h4>');
  14. p($l->t('Previous'));
  15. print_unescaped('</h4>');
  16. print_exception($e->getPrevious(), $l);
  17. }
  18. }