diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 8298dd3..e3e7fec 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -7,7 +7,6 @@ namespace OCA\Dropbox\Notification; -use InvalidArgumentException; use OCA\Dropbox\AppInfo\Application; use OCP\IURLGenerator; use OCP\IUserManager; @@ -15,6 +14,7 @@ use OCP\Notification\IManager as INotificationManager; use OCP\Notification\INotification; use OCP\Notification\INotifier; +use OCP\Notification\UnknownNotificationException; class Notifier implements INotifier { @@ -49,13 +49,13 @@ public function getName(): string { * @param INotification $notification * @param string $languageCode The code of the language that should be used to prepare the notification * @return INotification - * @throws InvalidArgumentException When the notification was not prepared by a notifier + * @throws UnknownNotificationException When the notification was not prepared by a notifier * @since 9.0.0 */ public function prepare(INotification $notification, string $languageCode): INotification { if ($notification->getApp() !== 'integration_dropbox') { // Not my app => throw - throw new InvalidArgumentException(); + throw new UnknownNotificationException(); } $l = $this->factory->get('integration_dropbox', $languageCode); @@ -75,7 +75,7 @@ public function prepare(INotification $notification, string $languageCode): INot default: // Unknown subject => Unknown notification => throw - throw new InvalidArgumentException(); + throw new UnknownNotificationException(); } } }