diff options
author | Joas Schilling <coding@schilljs.com> | 2024-06-25 11:20:48 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-06-25 11:56:24 +0200 |
commit | 8130968a352bcf66606a076598fa4a58a291bc6d (patch) | |
tree | ed7d9c5bfc0d7e1b3c63348f0416d96cb51fb6ef /apps/federatedfilesharing | |
parent | 9496ce6c7a35f5a6d151b78d78a45b1c900b3b2a (diff) | |
download | nextcloud-server-8130968a352bcf66606a076598fa4a58a291bc6d.tar.gz nextcloud-server-8130968a352bcf66606a076598fa4a58a291bc6d.zip |
feat(notifications): Migrate server INotifiers to new exceptions
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/federatedfilesharing')
-rw-r--r-- | apps/federatedfilesharing/lib/Notifier.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/federatedfilesharing/lib/Notifier.php b/apps/federatedfilesharing/lib/Notifier.php index 44e46b6a3ab..4c4380d0875 100644 --- a/apps/federatedfilesharing/lib/Notifier.php +++ b/apps/federatedfilesharing/lib/Notifier.php @@ -15,6 +15,7 @@ use OCP\IURLGenerator; use OCP\L10N\IFactory; use OCP\Notification\INotification; use OCP\Notification\INotifier; +use OCP\Notification\UnknownNotificationException; class Notifier implements INotifier { /** @var IFactory */ @@ -65,12 +66,12 @@ class Notifier implements INotifier { * @param INotification $notification * @param string $languageCode The code of the language that should be used to prepare the notification * @return INotification - * @throws \InvalidArgumentException + * @throws UnknownNotificationException */ public function prepare(INotification $notification, string $languageCode): INotification { if ($notification->getApp() !== 'files_sharing' || $notification->getObjectType() !== 'remote_share') { // Not my app => throw - throw new \InvalidArgumentException(); + throw new UnknownNotificationException(); } // Read the language from the notification @@ -141,7 +142,7 @@ class Notifier implements INotifier { default: // Unknown subject => Unknown notification => throw - throw new \InvalidArgumentException(); + throw new UnknownNotificationException(); } } |