diff --git a/pandora_console/include/rest-api/index.php b/pandora_console/include/rest-api/index.php index ee352f5100..6a9a1e582b 100644 --- a/pandora_console/include/rest-api/index.php +++ b/pandora_console/include/rest-api/index.php @@ -20,7 +20,7 @@ if ($method) { echo $viewer->{$method}(); } } catch (Exception $e) { - echo json_encode(['error' => $e->msg()]); + echo json_encode(['error' => $e->getMessage()]); return; } diff --git a/pandora_console/include/rest-api/models/VisualConsole/View.php b/pandora_console/include/rest-api/models/VisualConsole/View.php index 973744d098..5dbc2e5188 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/View.php +++ b/pandora_console/include/rest-api/models/VisualConsole/View.php @@ -45,7 +45,7 @@ class View extends \HTML * * @return string HTML code for Form. * - * @throws Exception On error. + * @throws \Exception On error. */ public function loadForm() { @@ -64,7 +64,11 @@ class View extends \HTML $itemClass = VisualConsole::getItemClass($type); if (!isset($itemClass)) { - throw new Exception(__('Item type not valid ['.$type.']')); + throw new \Exception(__('Item type not valid ['.$type.']')); + } + + if (\method_exists($itemClass, 'getFormInputs') === false) { + throw new \Exception(__('Item type has no getFormInputs method ['.$type.']')); } $form = [