Catch errors from remote calendars, they shouldn't cause fatal errors.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 20 Oct 2010 15:39:11 +0000 (11:39 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 20 Oct 2010 15:39:11 +0000 (11:39 -0400)
kronolith/lib/Kronolith.php

index de785d7..0893756 100644 (file)
@@ -1561,11 +1561,15 @@ class Kronolith
         }
 
         foreach ($GLOBALS['all_remote_calendars'] as $id => $calendar) {
-            if ($calendar->hasPermission($permission) &&
-                (!$display || $calendar->display())) {
-                if ($flat) {
-                    $calendars['remote_' . $id] = $calendar;
+            try {
+                if ($calendar->hasPermission($permission) &&
+                    (!$display || $calendar->display())) {
+                    if ($flat) {
+                        $calendars['remote_' . $id] = $calendar;
+                    }
                 }
+            } catch (Kronolith_Exception $e) {
+                $GLOBALS['notification']->push(sprintf(_("The calendar %s returned the error: %s"), $calendar->name(), $e->getMessage()), 'horde.error');
             }
         }