diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index b59ec031..98b9c58d 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -48,13 +48,11 @@ public function getName(): string { } private function createNotificationException(string $message): \Exception { - return class_exists(UnknownNotificationException::class) - ? new UnknownNotificationException($message) - : new \InvalidArgumentException($message); + return new UnknownNotificationException($message); } /** - * @throws \InvalidArgumentException When the notification was not prepared by a notifier + * @throws \OCP\Notification\UnknownNotificationException When the notification is not known */ public function prepare(INotification $notification, string $languageCode): INotification { if ($notification->getApp() !== Application::APP_ID) {