]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix: remove non-existing reminder notification
authorChristopher Ng <chrng8@gmail.com>
Fri, 4 Aug 2023 16:35:36 +0000 (09:35 -0700)
committerChristopher Ng <chrng8@gmail.com>
Wed, 9 Aug 2023 17:41:18 +0000 (10:41 -0700)
Signed-off-by: Christopher Ng <chrng8@gmail.com>
apps/files_reminders/lib/Notification/Notifier.php

index 2a919d42cae8349b333cd3473ea46935da85bac8..c528aa521b177d23f0d65d9bc9a2b4f86400862a 100644 (file)
@@ -34,6 +34,7 @@ use OCP\AppFramework\Db\DoesNotExistException;
 use OCP\Files\FileInfo;
 use OCP\IURLGenerator;
 use OCP\L10N\IFactory;
+use OCP\Notification\AlreadyProcessedException;
 use OCP\Notification\IAction;
 use OCP\Notification\INotification;
 use OCP\Notification\INotifier;
@@ -55,6 +56,7 @@ class Notifier implements INotifier {
 
        /**
         * @throws InvalidArgumentException
+        * @throws AlreadyProcessedException
         */
        public function prepare(INotification $notification, string $languageCode): INotification {
                $l = $this->l10nFactory->get(Application::APP_ID, $languageCode);
@@ -69,7 +71,7 @@ class Notifier implements INotifier {
                                try {
                                        $reminder = $this->reminderService->get($reminderId);
                                } catch (DoesNotExistException $e) {
-                                       throw new InvalidArgumentException();
+                                       throw new AlreadyProcessedException();
                                }
 
                                try {