diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 91b276a3d..98426a08b 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -13,6 +13,7 @@ use OCP\Notification\IManager as INotificationManager; use OCP\Notification\INotification; use OCP\Notification\INotifier; +use OCP\Notification\UnknownNotificationException; use OCP\User\Backend\ISetPasswordBackend; class Notifier implements INotifier { @@ -74,7 +75,7 @@ public function getName(): string { public function prepare(INotification $notification, string $languageCode): INotification { if ($notification->getApp() !== 'firstrunwizard') { // Not my app => throw - throw new \InvalidArgumentException(); + throw new UnknownNotificationException(); } switch ($notification->getSubject()) { @@ -83,7 +84,7 @@ public function prepare(INotification $notification, string $languageCode): INot if ($subject === '') { // Everything done, mark the notification as processed... $this->notificationManager->markProcessed($notification); - throw new \InvalidArgumentException(); + throw new UnknownNotificationException(); } $notification->setParsedSubject($subject) @@ -105,7 +106,7 @@ public function prepare(INotification $notification, string $languageCode): INot return $this->setAppHintDetails($notification, $languageCode, $app); default: // Unknown subject => Unknown notification => throw - throw new \InvalidArgumentException(); + throw new UnknownNotificationException(); } }