From: Chuck Hagenbuch Date: Mon, 17 Aug 2009 02:27:43 +0000 (-0400) Subject: throw an exception if an API class doesn't exist, instead of a fatal error X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=19ee8372fff9a6253644926852d4035fdd402536;p=horde.git throw an exception if an API class doesn't exist, instead of a fatal error --- diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index 771c25f34..b90ad11b2 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -384,8 +384,11 @@ class Horde_Registry $classname = 'Horde_Registry_' . $cname; } - $this->_cache['ob'][$app][$type] = new $classname; + if (!class_exists($classname, false)) { + throw new Horde_Exception("$app does not have an API"); + } + $this->_cache['ob'][$app][$type] = new $classname; return $this->_cache['ob'][$app][$type]; }