From c83c30e0b2ae55c63e64210397b0befd50ab94c3 Mon Sep 17 00:00:00 2001 From: Lukas Schaefer Date: Mon, 18 May 2026 11:23:14 +0200 Subject: [PATCH] Fix: throw UnknownActivityException on Notifier Signed-off-by: Lukas Schaefer --- lib/Notification/Notifier.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 4740787d..f04ea464 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -12,12 +12,12 @@ namespace OCA\Google\Notification; -use InvalidArgumentException; use OCA\Google\AppInfo\Application; use OCP\IURLGenerator; use OCP\L10N\IFactory; use OCP\Notification\INotification; use OCP\Notification\INotifier; +use OCP\Notification\UnknownNotificationException; class Notifier implements INotifier { @@ -50,13 +50,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_google') { // Not my app => throw - throw new InvalidArgumentException(); + throw new UnknownNotificationException(); } $l = $this->factory->get('integration_google', $languageCode); @@ -88,7 +88,7 @@ public function prepare(INotification $notification, string $languageCode): INot default: // Unknown subject => Unknown notification => throw - throw new InvalidArgumentException(); + throw new UnknownNotificationException(); } } }