From: Jan Schneider Date: Mon, 7 Sep 2009 13:23:26 +0000 (+0200) Subject: Catch exceptions too, so that the callback in js is still called. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=fe51fd9aac780e6f80d281c2b969141d089bc737;p=horde.git Catch exceptions too, so that the callback in js is still called. --- diff --git a/kronolith/ajax.php b/kronolith/ajax.php index d60d6c1d5..19374db0a 100644 --- a/kronolith/ajax.php +++ b/kronolith/ajax.php @@ -197,14 +197,19 @@ try { case 'QuickSaveEvent': $kronolith_driver = Kronolith::getDriver(); - $event = Kronolith::quickAdd(Horde_Util::getFormData('text'), - Kronolith::getDefaultCalendar(PERMS_EDIT)); - if (is_a($event, 'PEAR_Error')) { - $notification->push($event, 'horde.error'); + try { + $event = Kronolith::quickAdd(Horde_Util::getFormData('text'), + Kronolith::getDefaultCalendar(PERMS_EDIT)); + if (is_a($event, 'PEAR_Error')) { + $notification->push($event, 'horde.error'); + $result = true; + break; + } + $result = saveEvent($event); + } catch (Horde_Exception $e) { + $notification->push($e); $result = true; - break; } - $result = saveEvent($event); break; case 'UpdateEvent':