From: Jan Schneider Date: Sat, 12 Jun 2010 15:40:45 +0000 (+0200) Subject: Catch exceptions from getEvent(). X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=2eaf4ee2c1300ac2c409d5a2847310936f28be7d;p=horde.git Catch exceptions from getEvent(). --- diff --git a/kronolith/lib/Ajax/Application.php b/kronolith/lib/Ajax/Application.php index 8c0f6e439..3d1af5a1f 100644 --- a/kronolith/lib/Ajax/Application.php +++ b/kronolith/lib/Ajax/Application.php @@ -110,11 +110,16 @@ class Kronolith_Ajax_Application extends Horde_Ajax_Application_Base } } - $event = $kronolith_driver->getEvent($this->_vars->event); - if (!$event) { + try { + $event = $kronolith_driver->getEvent($this->_vars->event); + } catch (Horde_Exception_NotFound $e) { $GLOBALS['notification']->push(_("The requested event was not found."), 'horde.error'); return $result; - } elseif (!$event->hasPermission(Horde_Perms::EDIT)) { + } catch (Exception $e) { + $GLOBALS['notification']->push($e); + return $result; + } + if (!$event->hasPermission(Horde_Perms::EDIT)) { $GLOBALS['notification']->push(_("You do not have permission to edit this event."), 'horde.warning'); return $result; }