From: Michael J. Rubinsky Date: Thu, 13 Jan 2011 06:05:13 +0000 (-0500) Subject: throw exceptions X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e1f0da8f9202e9cec21e2d609740ce880a254b46;p=horde.git throw exceptions --- diff --git a/nag/lib/Api.php b/nag/lib/Api.php index 03c112d26..efd58a9c5 100644 --- a/nag/lib/Api.php +++ b/nag/lib/Api.php @@ -1389,17 +1389,18 @@ class Nag_Api extends Horde_Registry_Api * At the moment only the title, description and due date are saved. * * @param array $timeobject A time object hash. + * @throws Nag_Exception */ public function saveTimeObject($timeobject) { $storage = Nag_Driver::singleton(); $existing = $storage->get($timeobject['id']); if (is_a($existing, 'PEAR_Error')) { - return $existing; + throw new Nag_Exception($existing->getMessage()); } if (!array_key_exists($existing->tasklist, Nag::listTasklists(false, Horde_Perms::EDIT))) { - return PEAR::raiseError(_("Permission Denied")); + throw new Horde_Exception_PermissionDenied(_("Permission Denied")); } $storage = Nag_Driver::singleton($existing->tasklist);