From 2eaf4ee2c1300ac2c409d5a2847310936f28be7d Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Sat, 12 Jun 2010 17:40:45 +0200 Subject: [PATCH] Catch exceptions from getEvent(). --- kronolith/lib/Ajax/Application.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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; } -- 2.11.0