aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2024-09-16 15:09:39 +0200
committerAnna Larch <anna@nextcloud.com>2024-09-17 12:06:24 +0200
commit1ce46c1fca9797bb2bd5c160c5976eeec828ae32 (patch)
tree1a239cffc8f412e2ad1f5c637905f4acb119069d /apps/settings
parent4e64a6eb48dc5ba5bf3e31c1f58b1fcf710e255b (diff)
downloadnextcloud-server-1ce46c1fca9797bb2bd5c160c5976eeec828ae32.tar.gz
nextcloud-server-1ce46c1fca9797bb2bd5c160c5976eeec828ae32.zip
refactor: move to new activity exceptionrefactor/move-to-new-activity-exception
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps/settings')
-rw-r--r--apps/settings/lib/Activity/GroupProvider.php6
-rw-r--r--apps/settings/lib/Activity/Provider.php7
-rw-r--r--apps/settings/lib/Activity/SecurityProvider.php6
3 files changed, 10 insertions, 9 deletions
diff --git a/apps/settings/lib/Activity/GroupProvider.php b/apps/settings/lib/Activity/GroupProvider.php
index bad2c0c7a35..fc7189c774d 100644
--- a/apps/settings/lib/Activity/GroupProvider.php
+++ b/apps/settings/lib/Activity/GroupProvider.php
@@ -5,7 +5,7 @@
*/
namespace OCA\Settings\Activity;
-use InvalidArgumentException;
+use OCP\Activity\Exceptions\UnknownActivityException;
use OCP\Activity\IEvent;
use OCP\Activity\IManager;
use OCP\Activity\IProvider;
@@ -48,7 +48,7 @@ class GroupProvider implements IProvider {
public function parse($language, IEvent $event, ?IEvent $previousEvent = null) {
if ($event->getType() !== 'group_settings') {
- throw new InvalidArgumentException();
+ throw new UnknownActivityException();
}
$l = $this->l10n->get('settings', $language);
@@ -95,7 +95,7 @@ class GroupProvider implements IProvider {
}
break;
default:
- throw new InvalidArgumentException();
+ throw new UnknownActivityException();
}
$this->setSubjects($event, $subject, $parsedParameters);
diff --git a/apps/settings/lib/Activity/Provider.php b/apps/settings/lib/Activity/Provider.php
index ab9a8e3c85c..8d726c8da22 100644
--- a/apps/settings/lib/Activity/Provider.php
+++ b/apps/settings/lib/Activity/Provider.php
@@ -8,6 +8,7 @@ declare(strict_types=1);
*/
namespace OCA\Settings\Activity;
+use OCP\Activity\Exceptions\UnknownActivityException;
use OCP\Activity\IEvent;
use OCP\Activity\IManager;
use OCP\Activity\IProvider;
@@ -60,12 +61,12 @@ class Provider implements IProvider {
* @param IEvent $event
* @param IEvent|null $previousEvent
* @return IEvent
- * @throws \InvalidArgumentException
+ * @throws UnknownActivityException
* @since 11.0.0
*/
public function parse($language, IEvent $event, ?IEvent $previousEvent = null): IEvent {
if ($event->getApp() !== 'settings') {
- throw new \InvalidArgumentException('Unknown app');
+ throw new UnknownActivityException('Unknown app');
}
$this->l = $this->languageFactory->get('settings', $language);
@@ -105,7 +106,7 @@ class Provider implements IProvider {
} elseif ($event->getSubject() === self::APP_TOKEN_FILESYSTEM_REVOKED) {
$subject = $this->l->t('You revoked filesystem access from app password "{token}"');
} else {
- throw new \InvalidArgumentException('Unknown subject');
+ throw new UnknownActivityException('Unknown subject');
}
$parsedParameters = $this->getParameters($event);
diff --git a/apps/settings/lib/Activity/SecurityProvider.php b/apps/settings/lib/Activity/SecurityProvider.php
index a67b9cf365e..8e2b4f8f45a 100644
--- a/apps/settings/lib/Activity/SecurityProvider.php
+++ b/apps/settings/lib/Activity/SecurityProvider.php
@@ -8,7 +8,7 @@ declare(strict_types=1);
*/
namespace OCA\Settings\Activity;
-use InvalidArgumentException;
+use OCP\Activity\Exceptions\UnknownActivityException;
use OCP\Activity\IEvent;
use OCP\Activity\IManager;
use OCP\Activity\IProvider;
@@ -34,7 +34,7 @@ class SecurityProvider implements IProvider {
public function parse($language, IEvent $event, ?IEvent $previousEvent = null) {
if ($event->getType() !== 'security') {
- throw new InvalidArgumentException();
+ throw new UnknownActivityException();
}
$l = $this->l10n->get('settings', $language);
@@ -85,7 +85,7 @@ class SecurityProvider implements IProvider {
}
break;
default:
- throw new InvalidArgumentException();
+ throw new UnknownActivityException();
}
return $event;
}