Skip to content

Commit c83c30e

Browse files
committed
Fix: throw UnknownActivityException on Notifier
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
1 parent 555bfef commit c83c30e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/Notification/Notifier.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212

1313
namespace OCA\Google\Notification;
1414

15-
use InvalidArgumentException;
1615
use OCA\Google\AppInfo\Application;
1716
use OCP\IURLGenerator;
1817
use OCP\L10N\IFactory;
1918
use OCP\Notification\INotification;
2019
use OCP\Notification\INotifier;
20+
use OCP\Notification\UnknownNotificationException;
2121

2222
class Notifier implements INotifier {
2323

@@ -50,13 +50,13 @@ public function getName(): string {
5050
* @param INotification $notification
5151
* @param string $languageCode The code of the language that should be used to prepare the notification
5252
* @return INotification
53-
* @throws InvalidArgumentException When the notification was not prepared by a notifier
53+
* @throws UnknownNotificationException When the notification was not prepared by a notifier
5454
* @since 9.0.0
5555
*/
5656
public function prepare(INotification $notification, string $languageCode): INotification {
5757
if ($notification->getApp() !== 'integration_google') {
5858
// Not my app => throw
59-
throw new InvalidArgumentException();
59+
throw new UnknownNotificationException();
6060
}
6161

6262
$l = $this->factory->get('integration_google', $languageCode);
@@ -88,7 +88,7 @@ public function prepare(INotification $notification, string $languageCode): INot
8888

8989
default:
9090
// Unknown subject => Unknown notification => throw
91-
throw new InvalidArgumentException();
91+
throw new UnknownNotificationException();
9292
}
9393
}
9494
}

0 commit comments

Comments
 (0)