Skip to content

Commit 1c783e2

Browse files
committed
Notifier.php: Use UnknownNotificationException instead of InvalidArgumentException which is deprecated (fixes #62)
1 parent af7a7d2 commit 1c783e2

File tree

2 files changed

+5523
-4061
lines changed

2 files changed

+5523
-4061
lines changed

lib/Notification/Notifier.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
namespace OCA\Secrets\Notification;
88

99
use Exception;
10-
use InvalidArgumentException;
1110
use OCA\Secrets\AppInfo\Application;
1211
use OCA\Secrets\Service\SecretService;
1312
use OCP\IURLGenerator;
1413
use OCP\L10N\IFactory;
1514
use OCP\Notification\AlreadyProcessedException;
1615
use OCP\Notification\INotification;
1716
use OCP\Notification\INotifier;
17+
use OCP\Notification\UnknownNotificationException;
1818
use Psr\Log\LoggerInterface;
1919

2020
class Notifier implements INotifier {
@@ -54,13 +54,13 @@ public function getName(): string {
5454
* @param INotification $notification
5555
* @param string $languageCode The code of the language that should be used to prepare the notification
5656
* @return INotification
57-
* @throws InvalidArgumentException When the notification was not prepared by a notifier
57+
* @throws UnknownNotificationException When the notification was not prepared by a notifier
5858
* @throws AlreadyProcessedException When the notification is not needed anymore and should be deleted
5959
* @since 9.0.0
6060
*/
6161
public function prepare(INotification $notification, string $languageCode): INotification {
6262
if ($notification->getApp() != Application::APP_ID) {
63-
throw new InvalidArgumentException("Unknown app: " . $notification->getApp());
63+
throw new UnknownNotificationException("Unknown app: " . $notification->getApp());
6464
}
6565
try {
6666
$secret = $this->secretService->find($notification->getObjectId(), $notification->getUser());

0 commit comments

Comments
 (0)