Last of the pear error checks in krono that are in our control...
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 13 Jan 2011 06:09:20 +0000 (01:09 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 13 Jan 2011 06:09:20 +0000 (01:09 -0500)
Still have checks in places like the Holiday driver, where we can't
get around that due to PEAR_Holidays using them.

kronolith/lib/Driver/Horde.php

index 51e26f9..b44a445 100644 (file)
@@ -112,7 +112,6 @@ class Kronolith_Driver_Horde extends Kronolith_Driver
      * @param Kronolith_Event_Horde $event  The event to save.
      *
      * @return string  The event id.
-     * @throws Horde_Exception
      * @throws Kronolith_Exception
      */
     protected function _updateEvent($event)
@@ -120,10 +119,12 @@ class Kronolith_Driver_Horde extends Kronolith_Driver
         if (!isset($this->api)) {
             list($this->api, $category) = explode('/', $this->calendar, 2);
         }
-        $result = $this->_params['registry']->call($this->api . '/saveTimeObject', array($event->timeobject));
-        if ($result instanceof PEAR_Error) {
-            throw new Kronolith_Exception($result);
+        try {
+            $this->_params['registry']->call($this->api . '/saveTimeObject', array($event->timeobject));
+        } catch (Horde_Exception $e) {
+            throw new Kronolith_Exception($e);
         }
+
         return $event->timeobject['id'];
     }