2015-08-07 10:04:27 -04:00
|
|
|
<?php
|
2024-05-28 06:34:11 -04:00
|
|
|
|
2015-08-07 10:04:27 -04:00
|
|
|
/**
|
2024-05-28 06:34:11 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2015-08-07 10:04:27 -04:00
|
|
|
*/
|
2016-05-25 10:04:15 -04:00
|
|
|
namespace OCA\DAV\Tests\unit\Connector\Sabre\RequestTest;
|
2015-08-07 10:04:27 -04:00
|
|
|
|
2024-10-10 06:40:31 -04:00
|
|
|
use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin;
|
|
|
|
|
|
|
|
|
|
class ExceptionPlugin extends ExceptionLoggerPlugin {
|
2015-08-07 10:04:27 -04:00
|
|
|
/**
|
2020-06-08 05:30:05 -04:00
|
|
|
* @var \Throwable[]
|
2015-08-07 10:04:27 -04:00
|
|
|
*/
|
|
|
|
|
protected $exceptions = [];
|
|
|
|
|
|
2023-01-20 02:38:43 -05:00
|
|
|
public function logException(\Throwable $ex): void {
|
2015-08-07 10:04:27 -04:00
|
|
|
$exceptionClass = get_class($ex);
|
|
|
|
|
if (!isset($this->nonFatalExceptions[$exceptionClass])) {
|
|
|
|
|
$this->exceptions[] = $ex;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2020-06-08 05:30:05 -04:00
|
|
|
* @return \Throwable[]
|
2015-08-07 10:04:27 -04:00
|
|
|
*/
|
|
|
|
|
public function getExceptions() {
|
|
|
|
|
return $this->exceptions;
|
|
|
|
|
}
|
|
|
|
|
}
|