File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace OCA \Approval \Notification ;
13
13
14
- use InvalidArgumentException ;
15
14
use OCA \Approval \AppInfo \Application ;
16
15
use OCP \IURLGenerator ;
17
16
use OCP \IUser ;
18
17
use OCP \IUserManager ;
19
18
use OCP \L10N \IFactory ;
20
19
use OCP \Notification \INotification ;
21
-
22
20
use OCP \Notification \INotifier ;
21
+ use OCP \Notification \UnknownNotificationException ;
23
22
24
23
class Notifier implements INotifier {
25
24
@@ -53,13 +52,13 @@ public function getName(): string {
53
52
* @param INotification $notification
54
53
* @param string $languageCode The code of the language that should be used to prepare the notification
55
54
* @return INotification
56
- * @throws InvalidArgumentException When the notification was not prepared by a notifier
55
+ * @throws UnknownNotificationException When the notification was not prepared by a notifier
57
56
* @since 9.0.0
58
57
*/
59
58
public function prepare (INotification $ notification , string $ languageCode ): INotification {
60
59
if ($ notification ->getApp () !== Application::APP_ID ) {
61
60
// Not my app => throw
62
- throw new InvalidArgumentException ();
61
+ throw new UnknownNotificationException ();
63
62
}
64
63
65
64
$ l = $ this ->factory ->get (Application::APP_ID , $ languageCode );
@@ -163,7 +162,7 @@ public function prepare(INotification $notification, string $languageCode): INot
163
162
164
163
default :
165
164
// Unknown subject => Unknown notification => throw
166
- throw new InvalidArgumentException ();
165
+ throw new UnknownNotificationException ();
167
166
}
168
167
}
169
168
}
You can’t perform that action at this time.
0 commit comments