diff --git a/library/Director/Web/Controller/ObjectsController.php b/library/Director/Web/Controller/ObjectsController.php index 03df8fd4..a07aa781 100644 --- a/library/Director/Web/Controller/ObjectsController.php +++ b/library/Director/Web/Controller/ObjectsController.php @@ -213,8 +213,8 @@ abstract class ObjectsController extends ActionController /** * @throws \Icinga\Exception\ConfigurationError * @throws \Icinga\Exception\Http\HttpNotFoundException - * @throws \Icinga\Exception\ProgrammingError * @throws \Icinga\Security\SecurityException + * @throws NotFoundError */ public function applyrulesAction() { @@ -256,6 +256,7 @@ abstract class ObjectsController extends ActionController * @throws NotFoundError * @throws \Icinga\Exception\ConfigurationError * @throws \Icinga\Exception\Http\HttpNotFoundException + * @throws \Icinga\Security\SecurityException */ public function setsAction() { @@ -325,7 +326,6 @@ abstract class ObjectsController extends ActionController * @param string $name * * @return \Icinga\Module\Director\Web\Form\QuickForm - * @throws \Icinga\Exception\ProgrammingError */ public function loadForm($name) { @@ -342,6 +342,7 @@ abstract class ObjectsController extends ActionController * @param ZfQueryBasedTable $table * @return ZfQueryBasedTable * @throws \Icinga\Exception\ConfigurationError + * @throws NotFoundError */ protected function eventuallyFilterCommand(ZfQueryBasedTable $table) { diff --git a/library/Director/Web/Form/FormLoader.php b/library/Director/Web/Form/FormLoader.php index 50d688ff..ea828579 100644 --- a/library/Director/Web/Form/FormLoader.php +++ b/library/Director/Web/Form/FormLoader.php @@ -5,13 +5,18 @@ namespace Icinga\Module\Director\Web\Form; use Icinga\Application\Icinga; use Icinga\Application\Modules\Module; use Icinga\Exception\ProgrammingError; +use RuntimeException; class FormLoader { public static function load($name, Module $module = null) { if ($module === null) { - $basedir = Icinga::app()->getApplicationDir('forms'); + try { + $basedir = Icinga::app()->getApplicationDir('forms'); + } catch (ProgrammingError $e) { + throw new RuntimeException($e->getMessage(), 0, $e); + } $ns = '\\Icinga\\Web\\Forms\\'; } else { $basedir = $module->getFormDir(); @@ -32,6 +37,7 @@ class FormLoader return new $class($options); } } - throw new ProgrammingError(sprintf('Cannot load %s (%s), no such form', $name, $file)); + + throw new RuntimeException(sprintf('Cannot load %s (%s), no such form', $name, $file)); } }