Horde_Share doesn't throw exceptions yet.
authorJan Schneider <jan@horde.org>
Mon, 15 Feb 2010 14:43:46 +0000 (15:43 +0100)
committerJan Schneider <jan@horde.org>
Mon, 15 Feb 2010 17:03:59 +0000 (18:03 +0100)
kronolith/lib/FreeBusy.php

index 5746e94..a73b4b8 100644 (file)
@@ -32,10 +32,8 @@ class Kronolith_FreeBusy
         }
 
         /* Fetch the appropriate share and check permissions. */
-        try {
-            $share = $kronolith_shares->getShare($calendar[0]);
-            $owner = $share->get('owner');
-        } catch (Exception $e) {
+        $share = $kronolith_shares->getShare($calendar[0]);
+        if ($share instanceof PEAR_Error) {
             // Might be a Kronolith_Resource
             try {
                 $resource = Kronolith_Resource::isResourceCalendar($calendar[0]);
@@ -43,6 +41,8 @@ class Kronolith_FreeBusy
             } catch (Horde_Exception $e) {
                 return $returnObj ? $share : '';
             }
+        } else {
+            $owner = $share->get('owner');
         }
 
         /* Default the start date to today. */