Skip to content

Commit 0f53a52

Browse files
authored
Merge pull request #358 from nextcloud/fix/UnknownActivityException
Fix: throw UnknownActivityException on Notifier
2 parents adc0380 + c83c30e commit 0f53a52

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);
@@ -86,7 +86,7 @@ public function prepare(INotification $notification, string $languageCode): INot
8686
return $notification;
8787
default:
8888
// Unknown subject => Unknown notification => throw
89-
throw new InvalidArgumentException();
89+
throw new UnknownNotificationException();
9090
}
9191
}
9292
}

0 commit comments

Comments
 (0)