ExceptionPlugin.php 701 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCA\DAV\Tests\unit\Connector\Sabre\RequestTest;
  8. use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin;
  9. class ExceptionPlugin extends ExceptionLoggerPlugin {
  10. /**
  11. * @var \Throwable[]
  12. */
  13. protected $exceptions = [];
  14. public function logException(\Throwable $ex): void {
  15. $exceptionClass = get_class($ex);
  16. if (!isset($this->nonFatalExceptions[$exceptionClass])) {
  17. $this->exceptions[] = $ex;
  18. }
  19. }
  20. /**
  21. * @return \Throwable[]
  22. */
  23. public function getExceptions() {
  24. return $this->exceptions;
  25. }
  26. }