Commit da850387 authored by Carsten  Rose's avatar Carsten Rose
Browse files

HelperFormElement, KeyValueStringParser, AbstractBuildFormd, Constants,...

HelperFormElement, KeyValueStringParser, AbstractBuildFormd, Constants, Database: All Exceptions supplied with an error code
parent e8508c2e
...@@ -371,7 +371,7 @@ abstract class AbstractBuildForm { ...@@ -371,7 +371,7 @@ abstract class AbstractBuildForm {
default: default:
$this->store->setVar(SYSTEM_FORM_ELEMENT, $formElement['name'] . ' / ' . $formElement['id'], STORE_SYSTEM); $this->store->setVar(SYSTEM_FORM_ELEMENT, $formElement['name'] . ' / ' . $formElement['id'], STORE_SYSTEM);
$this->store->setVar(SYSTEM_FORM_ELEMENT_COLUMN, 'mode', STORE_SYSTEM); $this->store->setVar(SYSTEM_FORM_ELEMENT_COLUMN, 'mode', STORE_SYSTEM);
throw new UserException("Unexpected mode '" . $formElement['mode'] . "'"); throw new UserException("Unknown mode '" . $formElement['mode'] . "'", ERROR_UNKNOWN_MODE);
break; break;
} }
return $attribute; return $attribute;
...@@ -934,7 +934,7 @@ abstract class AbstractBuildForm { ...@@ -934,7 +934,7 @@ abstract class AbstractBuildForm {
*/ */
public function buildDateJQW(array $formElement, $htmlFormElementId, $value) { public function buildDateJQW(array $formElement, $htmlFormElementId, $value) {
// TODO: implement // TODO: implement
throw new UserException("Not implemented yet: buildDateJQW()"); throw new UserException("Not implemented yet: buildDateJQW()", ERROR_NOT_IMPLEMENTED);
} }
/** /**
...@@ -945,7 +945,7 @@ abstract class AbstractBuildForm { ...@@ -945,7 +945,7 @@ abstract class AbstractBuildForm {
*/ */
public function buildGridJQW(array $formElement, $htmlFormElementId, $value) { public function buildGridJQW(array $formElement, $htmlFormElementId, $value) {
// TODO: implement // TODO: implement
throw new UserException("Not implemented yet: buildGridJQW()"); throw new UserException("Not implemented yet: buildGridJQW()", ERROR_NOT_IMPLEMENTED);
} }
/** /**
......
...@@ -88,6 +88,13 @@ const ERROR_UNKNOWN_FORM_RENDER = 1028; ...@@ -88,6 +88,13 @@ const ERROR_UNKNOWN_FORM_RENDER = 1028;
const ERROR_NAME_LABEL_EMPTY = 1029; const ERROR_NAME_LABEL_EMPTY = 1029;
const ERROR_MISSING_COLUMN_ID = 1030; const ERROR_MISSING_COLUMN_ID = 1030;
const ERROR_DEBUG = 1031; const ERROR_DEBUG = 1031;
const ERROR_UNKNOWN_MODE = 1032;
const ERROR_NOT_IMPLEMENTED = 1033;
const ERROR_RESERVED_KEY_NAME = 1034;
const ERROR_VALUE_HAS_NO_KEY = 1035;
const ERROR_DB_EXECUTE = 1036;
const ERROR_COLUMN_NOT_FOUND_IN_TABLE = 1037;
// DB Errors // DB Errors
//const ERROR_DB_QUERY_SIMPLE = 2000; //const ERROR_DB_QUERY_SIMPLE = 2000;
......
...@@ -145,7 +145,7 @@ class Database { ...@@ -145,7 +145,7 @@ class Database {
return $row; return $row;
} }
} }
throw new DbException("Column name '$columnName' not found in table '$table'."); throw new DbException("Column name '$columnName' not found in table '$table'.", ERROR_COLUMN_NOT_FOUND_IN_TABLE);
} }
/** /**
...@@ -232,7 +232,7 @@ class Database { ...@@ -232,7 +232,7 @@ class Database {
$this->stmt = $this->pdo->prepare($sql); $this->stmt = $this->pdo->prepare($sql);
if (false === $this->stmt->execute($parameterArray)) { if (false === $this->stmt->execute($parameterArray)) {
throw new DbException($this->stmt->errorInfo()[2]); throw new DbException($this->stmt->errorInfo()[2], ERROR_DB_EXECUTE);
} }
$count = $this->stmt->rowCount(); $count = $this->stmt->rowCount();
......
...@@ -40,7 +40,7 @@ class HelperFormElement { ...@@ -40,7 +40,7 @@ class HelperFormElement {
$store = Store::getInstance(); $store = Store::getInstance();
$store->setVar(SYSTEM_FORM_ELEMENT, $element['name'] . ' / ' . $element['id'], STORE_SYSTEM); $store->setVar(SYSTEM_FORM_ELEMENT, $element['name'] . ' / ' . $element['id'], STORE_SYSTEM);
$store->setVar(SYSTEM_FORM_ELEMENT_COLUMN, 'parameter', STORE_SYSTEM); $store->setVar(SYSTEM_FORM_ELEMENT_COLUMN, 'parameter', STORE_SYSTEM);
throw new UserException("Found reserved keyname '$checkKey'"); throw new UserException("Found reserved keyname '$checkKey'", ERROR_RESERVED_KEY_NAME);
} }
} }
$elements[$key] = array_merge($element, $arr); $elements[$key] = array_merge($element, $arr);
......
...@@ -113,7 +113,7 @@ class KeyValueStringParser { ...@@ -113,7 +113,7 @@ class KeyValueStringParser {
if ($key === '') { if ($key === '') {
// ":", ":1" // ":", ":1"
throw new UserException("Value has no key: '$keyValuePairString'"); throw new UserException("Value has no key: '$keyValuePairString'", ERROR_VALUE_HAS_NO_KEY);
} }
if (count($keyValueArray) === 2) { if (count($keyValueArray) === 2) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment