diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 55b0ee53b7..ec965d3d3a 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -14,6 +14,7 @@ use OCP\L10N\IFactory; use OCP\Notification\INotification; use OCP\Notification\INotifier; +use OCP\Notification\UnknownNotificationException; class Notifier implements INotifier { private IFactory $factory; @@ -41,7 +42,7 @@ public function getName(): string { public function prepare(INotification $notification, string $languageCode): INotification { if ($notification->getApp() !== Application::APP_ID) { // Not my app => throw - throw new \InvalidArgumentException(); + throw new UnknownNotificationException(); } // Read the language from the notification @@ -69,7 +70,7 @@ public function prepare(INotification $notification, string $languageCode): INot ]); break; default: - throw new \InvalidArgumentException(); + throw new UnknownNotificationException(); } return $notification;