aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Notification
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2024-04-10 17:12:31 +0200
committerJoas Schilling <coding@schilljs.com>2024-04-12 10:30:38 +0200
commit0d0c2cdaa08f6bc8f547b437a5b046914680b3f5 (patch)
treebf3cfc57b5f7cf51eb39cc0947088a1059c81ec2 /lib/private/Notification
parentc8e4a29dfa5665a99077b8eeed645786a946f375 (diff)
downloadnextcloud-server-0d0c2cdaa08f6bc8f547b437a5b046914680b3f5.tar.gz
nextcloud-server-0d0c2cdaa08f6bc8f547b437a5b046914680b3f5.zip
fix(notifications): Add a dedicated exception when a notification was not parsed completely
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Notification')
-rw-r--r--lib/private/Notification/Manager.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/Notification/Manager.php b/lib/private/Notification/Manager.php
index 63374cea21f..df9d338beb0 100644
--- a/lib/private/Notification/Manager.php
+++ b/lib/private/Notification/Manager.php
@@ -36,6 +36,7 @@ use OCP\Notification\IDeferrableApp;
use OCP\Notification\IDismissableNotifier;
use OCP\Notification\IManager;
use OCP\Notification\IncompleteNotificationException;
+use OCP\Notification\IncompleteParsedNotificationException;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
use OCP\Notification\UnknownNotificationException;
@@ -365,13 +366,14 @@ class Manager implements IManager {
}
if (!$notification->isValidParsed()) {
- throw new \InvalidArgumentException('The given notification has not been handled');
+ $this->logger->info('Notification was claimed to be parsed, but was not fully parsed by ' . get_class($notifier) . ' [app: ' . $notification->getApp() . ', subject: ' . $notification->getSubject() . ']');
+ throw new IncompleteParsedNotificationException();
}
}
if (!$notification->isValidParsed()) {
$this->logger->info('Notification was not parsed by any notifier [app: ' . $notification->getApp() . ', subject: ' . $notification->getSubject() . ']');
- throw new \InvalidArgumentException('The given notification has not been handled');
+ throw new IncompleteParsedNotificationException();
}
return $notification;