summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-09-01 10:24:21 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-09-08 09:01:01 +0200
commit0bcae89d141fb8fd35477b5b847360fbf3eb32f1 (patch)
tree49b6981348d3e782353c9fc53c04c9166e872a10
parentf16c5a38a85270e2230d78ab355774238a325f5d (diff)
downloadnextcloud-server-0bcae89d141fb8fd35477b5b847360fbf3eb32f1.tar.gz
nextcloud-server-0bcae89d141fb8fd35477b5b847360fbf3eb32f1.zip
Handle InvalidArgumentException more gracefully
-rw-r--r--lib/private/notification/manager.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/private/notification/manager.php b/lib/private/notification/manager.php
index 0b3b68a4065..c721f610113 100644
--- a/lib/private/notification/manager.php
+++ b/lib/private/notification/manager.php
@@ -122,7 +122,10 @@ class Manager implements IManager {
$apps = $this->getApps();
foreach ($apps as $app) {
- $app->notify($notification);
+ try {
+ $app->notify($notification);
+ } catch (\InvalidArgumentException $e) {
+ }
}
}
@@ -139,11 +142,13 @@ class Manager implements IManager {
foreach ($notifiers as $notifier) {
try {
$notifier->prepare($notification, $languageCode);
- } catch (\InvalidArgumentException $e) {}
- }
+ } catch (\InvalidArgumentException $e) {
+ continue;
+ }
- if (!$notification->isValidParsed()) {
- throw new \InvalidArgumentException('The given notification has not been handled');
+ if (!$notification->isValidParsed()) {
+ throw new \InvalidArgumentException('The given notification has not been handled');
+ }
}
return $notification;