diff options
Diffstat (limited to 'apps/settings')
-rw-r--r-- | apps/settings/lib/Activity/GroupProvider.php | 6 | ||||
-rw-r--r-- | apps/settings/lib/Activity/Provider.php | 7 | ||||
-rw-r--r-- | apps/settings/lib/Activity/SecurityProvider.php | 6 |
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; } |