aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2024-06-25 11:20:48 +0200
committerJoas Schilling <coding@schilljs.com>2024-06-25 11:56:24 +0200
commit8130968a352bcf66606a076598fa4a58a291bc6d (patch)
treeed7d9c5bfc0d7e1b3c63348f0416d96cb51fb6ef /apps/user_ldap/lib
parent9496ce6c7a35f5a6d151b78d78a45b1c900b3b2a (diff)
downloadnextcloud-server-8130968a352bcf66606a076598fa4a58a291bc6d.tar.gz
nextcloud-server-8130968a352bcf66606a076598fa4a58a291bc6d.zip
feat(notifications): Migrate server INotifiers to new exceptions
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/Notification/Notifier.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/Notification/Notifier.php b/apps/user_ldap/lib/Notification/Notifier.php
index 82050bd2596..ca0fa6f0335 100644
--- a/apps/user_ldap/lib/Notification/Notifier.php
+++ b/apps/user_ldap/lib/Notification/Notifier.php
@@ -8,6 +8,7 @@ namespace OCA\User_LDAP\Notification;
use OCP\L10N\IFactory;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
+use OCP\Notification\UnknownNotificationException;
class Notifier implements INotifier {
@@ -45,12 +46,12 @@ class Notifier implements INotifier {
* @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
*/
public function prepare(INotification $notification, string $languageCode): INotification {
if ($notification->getApp() !== 'user_ldap') {
// Not my app => throw
- throw new \InvalidArgumentException();
+ throw new UnknownNotificationException();
}
// Read the language from the notification
@@ -76,7 +77,7 @@ class Notifier implements INotifier {
default:
// Unknown subject => Unknown notification => throw
- throw new \InvalidArgumentException();
+ throw new UnknownNotificationException();
}
}
}