Merge pull request #1892 from nextcloud/techdebt/44770/notification-exceptions
fix(exceptions): Catch AlreadyProcessedException as well now
This commit is contained in:
Коммит
560e3e912d
|
@ -39,8 +39,10 @@ use OCP\IRequest;
|
|||
use OCP\IUser;
|
||||
use OCP\IUserSession;
|
||||
use OCP\L10N\IFactory;
|
||||
use OCP\Notification\AlreadyProcessedException;
|
||||
use OCP\Notification\IAction;
|
||||
use OCP\Notification\IManager;
|
||||
use OCP\Notification\IncompleteParsedNotificationException;
|
||||
use OCP\Notification\INotification;
|
||||
use OCP\UserStatus\IManager as IUserStatusManager;
|
||||
use OCP\UserStatus\IUserStatus;
|
||||
|
@ -116,7 +118,8 @@ class EndpointController extends OCSController {
|
|||
/** @var INotification $notification */
|
||||
try {
|
||||
$notification = $this->manager->prepare($notification, $language);
|
||||
} catch (\InvalidArgumentException) {
|
||||
} catch (AlreadyProcessedException|IncompleteParsedNotificationException|\InvalidArgumentException) {
|
||||
// FIXME remove \InvalidArgumentException in Nextcloud 39
|
||||
// The app was disabled, skip the notification
|
||||
continue;
|
||||
}
|
||||
|
@ -170,7 +173,8 @@ class EndpointController extends OCSController {
|
|||
|
||||
try {
|
||||
$notification = $this->manager->prepare($notification, $language);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
} catch (AlreadyProcessedException|IncompleteParsedNotificationException|\InvalidArgumentException) {
|
||||
// FIXME remove \InvalidArgumentException in Nextcloud 39
|
||||
// The app was disabled
|
||||
return new DataResponse(null, Http::STATUS_NOT_FOUND);
|
||||
}
|
||||
|
|
|
@ -38,8 +38,10 @@ use OCP\IUserManager;
|
|||
use OCP\L10N\IFactory;
|
||||
use OCP\Mail\IMailer;
|
||||
use OCP\Mail\IMessage;
|
||||
use OCP\Notification\AlreadyProcessedException;
|
||||
use OCP\Notification\IAction;
|
||||
use OCP\Notification\IManager;
|
||||
use OCP\Notification\IncompleteParsedNotificationException;
|
||||
use OCP\Notification\INotification;
|
||||
use OCP\Util;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
@ -200,7 +202,8 @@ class MailNotifications {
|
|||
/** @var INotification $preparedNotification */
|
||||
try {
|
||||
$preparedNotification = $this->manager->prepare($notification, $language);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
} catch (AlreadyProcessedException|IncompleteParsedNotificationException|\InvalidArgumentException) {
|
||||
// FIXME remove \InvalidArgumentException in Nextcloud 39
|
||||
// The app was disabled, skip the notification
|
||||
continue;
|
||||
} catch (\Exception $e) {
|
||||
|
|
|
@ -43,7 +43,9 @@ use OCP\IConfig;
|
|||
use OCP\IDBConnection;
|
||||
use OCP\IUser;
|
||||
use OCP\L10N\IFactory;
|
||||
use OCP\Notification\AlreadyProcessedException;
|
||||
use OCP\Notification\IManager as INotificationManager;
|
||||
use OCP\Notification\IncompleteParsedNotificationException;
|
||||
use OCP\Notification\INotification;
|
||||
use OCP\UserStatus\IManager as IUserStatusManager;
|
||||
use OCP\UserStatus\IUserStatus;
|
||||
|
@ -310,7 +312,8 @@ class Push {
|
|||
try {
|
||||
$this->notificationManager->setPreparingPushNotification(true);
|
||||
$notification = $this->notificationManager->prepare($notification, $language);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
} catch (AlreadyProcessedException|IncompleteParsedNotificationException|\InvalidArgumentException) {
|
||||
// FIXME remove \InvalidArgumentException in Nextcloud 39
|
||||
return;
|
||||
} finally {
|
||||
$this->notificationManager->setPreparingPushNotification(false);
|
||||
|
|
Загрузка…
Ссылка в новой задаче