Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(notifications): Notifier::prepare() threw \InvalidArgumentExcepti… #1272

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/Notifications/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

namespace OCA\Guests\Notifications;

use InvalidArgumentException;
use OCA\Guests\AppInfo\Application;
use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\L10N\IFactory;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
use OCP\Notification\UnknownNotificationException;

class Notifier implements INotifier {
public function __construct(
Expand Down Expand Up @@ -51,12 +51,12 @@ private function getRichMessageParams(string $source, string $target): array {
}

/**
* @throws InvalidArgumentException
* @throws UnknownNotificationException
*/
public function prepare(INotification $notification, string $languageCode): INotification {
if ($notification->getApp() !== Application::APP_ID) {
// Not my app => throw
throw new InvalidArgumentException();
throw new UnknownNotificationException();
}

// Read the language from the notification
Expand Down Expand Up @@ -95,7 +95,7 @@ public function prepare(INotification $notification, string $languageCode): INot

default:
// Unknown subject => Unknown notification => throw
throw new InvalidArgumentException();
throw new UnknownNotificationException();
}
}
}
Loading