Skip to content

Commit fe0b180

Browse files
Merge pull request #475 from nextcloud/bugfix/noid/notification-handling
fix(notifications): Notifier::prepare() threw \InvalidArgumentExcepti…
2 parents 280d887 + d647a43 commit fe0b180

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Notifications/ExAppNotifier.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
namespace OCA\AppAPI\Notifications;
1111

12-
use InvalidArgumentException;
1312
use OCA\AppAPI\AppInfo\Application;
1413
use OCA\AppAPI\Service\ExAppService;
1514
use OCP\IURLGenerator;
1615
use OCP\L10N\IFactory;
1716
use OCP\Notification\INotification;
1817
use OCP\Notification\INotifier;
18+
use OCP\Notification\UnknownNotificationException;
1919

2020
class ExAppNotifier implements INotifier {
2121

@@ -38,10 +38,10 @@ public function getName(): string {
3838
public function prepare(INotification $notification, string $languageCode): INotification {
3939
$exApp = $this->service->getExApp($notification->getApp());
4040
if ($exApp === null) {
41-
throw new InvalidArgumentException();
41+
throw new UnknownNotificationException();
4242
}
4343
if (!$exApp->getEnabled()) { // Only enabled ExApps can render notifications
44-
throw new InvalidArgumentException('ExApp is disabled');
44+
throw new UnknownNotificationException('ExApp is disabled');
4545
}
4646

4747
$l = $this->l10nFactory->get($notification->getApp(), $languageCode);

0 commit comments

Comments
 (0)