aboutsummaryrefslogtreecommitdiffstats
path: root/core/templates/print_exception.php
blob: bb66d5abce31f715d44d8666c2e29c478a84e889 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

use OCP\IL10N;

/**
 * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
 * SPDX-FileCopyrightText: 2012-2015 ownCloud, Inc.
 * SPDX-License-Identifier: AGPL-3.0-only
 */
function print_exception(Throwable $e, 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);
	}
}