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

[stable4.1] fix(notifications): Notifier::prepare() threw \InvalidArgumentExcepti… #10524

Merged
merged 1 commit into from
Dec 20, 2024
Merged
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
5 changes: 3 additions & 2 deletions lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use OCP\L10N\IFactory;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
use OCP\Notification\UnknownNotificationException;

class Notifier implements INotifier {
private IFactory $factory;
Expand Down Expand Up @@ -41,7 +42,7 @@
public function prepare(INotification $notification, string $languageCode): INotification {
if ($notification->getApp() !== Application::APP_ID) {
// Not my app => throw
throw new \InvalidArgumentException();
throw new UnknownNotificationException();

Check warning on line 45 in lib/Notification/Notifier.php

View check run for this annotation

Codecov / codecov/patch

lib/Notification/Notifier.php#L45

Added line #L45 was not covered by tests
}

// Read the language from the notification
Expand Down Expand Up @@ -69,7 +70,7 @@
]);
break;
default:
throw new \InvalidArgumentException();
throw new UnknownNotificationException();

Check warning on line 73 in lib/Notification/Notifier.php

View check run for this annotation

Codecov / codecov/patch

lib/Notification/Notifier.php#L73

Added line #L73 was not covered by tests
}

return $notification;
Expand Down