Skip to content

Commit 6f8a3d4

Browse files
authored
Merge pull request #1994 from nextcloud/carl/queryexception
refactor: Port away from QueryException
2 parents 54e38ad + 9bf65cf commit 6f8a3d4

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

lib/AP.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
use OCA\Social\Model\ActivityPub\Stream;
6262
use OCA\Social\Service\ConfigService;
6363
use OCA\Social\Tools\Traits\TArrayTools;
64-
use OCP\AppFramework\QueryException;
6564
use OCP\Server;
65+
use Psr\Container\ContainerExceptionInterface;
6666
use Psr\Log\LoggerInterface;
6767

6868
/**
@@ -147,10 +147,10 @@ public function __construct(
147147
$this->configService = $configService;
148148
}
149149

150-
public static function init() {
150+
public static function init(): void {
151151
try {
152152
AP::$activityPub = Server::get(AP::class);
153-
} catch (QueryException $e) {
153+
} catch (ContainerExceptionInterface $e) {
154154
Server::get(LoggerInterface::class)
155155
->error($e->getMessage(), ['exception' => $e]);
156156
}

lib/Cron/Cache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
use OCA\Social\Service\CacheActorService;
1515
use OCA\Social\Service\DocumentService;
1616
use OCA\Social\Service\HashtagService;
17-
use OCP\AppFramework\QueryException;
1817
use OCP\AppFramework\Utility\ITimeFactory;
1918
use OCP\BackgroundJob\TimedJob;
19+
use Psr\Container\ContainerExceptionInterface;
2020

2121
/**
2222
* Class Cache
@@ -41,7 +41,7 @@ public function __construct(ITimeFactory $time, AccountService $accountService,
4141
/**
4242
* @param mixed $argument
4343
*
44-
* @throws QueryException
44+
* @throws ContainerExceptionInterface
4545
*/
4646
protected function run($argument) {
4747
try {

lib/Cron/Queue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
use OCA\Social\Service\ActivityService;
1414
use OCA\Social\Service\RequestQueueService;
1515
use OCA\Social\Service\StreamQueueService;
16-
use OCP\AppFramework\QueryException;
1716
use OCP\AppFramework\Utility\ITimeFactory;
1817
use OCP\BackgroundJob\TimedJob;
18+
use Psr\Container\ContainerExceptionInterface;
1919

2020
/**
2121
* Class Queue
@@ -42,7 +42,7 @@ public function __construct(ITimeFactory $time, RequestQueueService $requestQueu
4242
/**
4343
* @param mixed $argument
4444
*
45-
* @throws QueryException
45+
* @throws ContainerExceptionInterface
4646
*/
4747
protected function run($argument) {
4848
$this->manageRequestQueue();

lib/Service/PushService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use OCA\Social\Exceptions\StreamNotFoundException;
1616
use OCA\Social\Model\ActivityPub\Actor\Person;
1717
use OCA\Social\Tools\Traits\TAsync;
18-
use OCP\AppFramework\QueryException;
18+
use Psr\Container\ContainerExceptionInterface;
1919

2020
//use OCP\Push\Exceptions\PushInstallException;
2121
//use OCP\Push\IPushManager;
@@ -49,8 +49,8 @@ public function __construct(
4949
// if ($this->miscService->getNcVersion() >= 19) {
5050
// try {
5151
// $this->pushManager = OC::$server->query(IPushManager::class);
52-
// } catch (QueryException $e) {
53-
// $miscService->log('QueryException while loading IPushManager - ' . $e->getMessage());
52+
// } catch (ContainerInterfaceException $e) {
53+
// $miscService->log('ContainerInterfaceException while loading IPushManager - ' . $e->getMessage());
5454
// }
5555
// }
5656
}

0 commit comments

Comments
 (0)