From: Michael J. Rubinsky Date: Thu, 13 Jan 2011 06:09:20 +0000 (-0500) Subject: Last of the pear error checks in krono that are in our control... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=8d1caf18e91541635a2d80d57ce692ca3a02bea4;p=horde.git Last of the pear error checks in krono that are in our control... Still have checks in places like the Holiday driver, where we can't get around that due to PEAR_Holidays using them. --- diff --git a/kronolith/lib/Driver/Horde.php b/kronolith/lib/Driver/Horde.php index 51e26f920..b44a44596 100644 --- a/kronolith/lib/Driver/Horde.php +++ b/kronolith/lib/Driver/Horde.php @@ -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']; }