-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Prevent duplicate creation of print_exception function
Signed-off-by: Louis Chemineau <louis@chmn.me>
- Loading branch information
1 parent
189930a
commit c255e70
Showing
4 changed files
with
39 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
/** | ||
* 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, \OCP\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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
/** | ||
* 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, \OCP\IL10N $l): void { | ||
p($e->getTraceAsString()); | ||
|
||
if ($e->getPrevious() !== null) { | ||
print_unescaped('<s:previous-exception>'); | ||
print_exception($e->getPrevious(), $l); | ||
print_unescaped('</s:previous-exception>'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters