1313use OCP \Notification \IManager as INotificationManager ;
1414use OCP \Notification \INotification ;
1515use OCP \Notification \INotifier ;
16+ use OCP \Notification \UnknownNotificationException ;
1617use OCP \User \Backend \ISetPasswordBackend ;
1718
1819class Notifier implements INotifier {
@@ -74,7 +75,7 @@ public function getName(): string {
7475 public function prepare (INotification $ notification , string $ languageCode ): INotification {
7576 if ($ notification ->getApp () !== 'firstrunwizard ' ) {
7677 // Not my app => throw
77- throw new \ InvalidArgumentException ();
78+ throw new UnknownNotificationException ();
7879 }
7980
8081 switch ($ notification ->getSubject ()) {
@@ -83,7 +84,7 @@ public function prepare(INotification $notification, string $languageCode): INot
8384 if ($ subject === '' ) {
8485 // Everything done, mark the notification as processed...
8586 $ this ->notificationManager ->markProcessed ($ notification );
86- throw new \ InvalidArgumentException ();
87+ throw new UnknownNotificationException ();
8788 }
8889
8990 $ notification ->setParsedSubject ($ subject )
@@ -105,7 +106,7 @@ public function prepare(INotification $notification, string $languageCode): INot
105106 return $ this ->setAppHintDetails ($ notification , $ languageCode , $ app );
106107 default :
107108 // Unknown subject => Unknown notification => throw
108- throw new \ InvalidArgumentException ();
109+ throw new UnknownNotificationException ();
109110 }
110111 }
111112
0 commit comments