From e1f0da8f9202e9cec21e2d609740ce880a254b46 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 13 Jan 2011 01:05:13 -0500 Subject: [PATCH] throw exceptions --- nag/lib/Api.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.11.0