Add exceptions from frontend

This commit is contained in:
2020-07-25 23:35:38 +02:00
committed by Stefan Rohde-Enslin
parent c61a9e0c5b
commit 7e35a39cf5
10 changed files with 223 additions and 0 deletions

View File

@ -0,0 +1,22 @@
<?PHP
declare(strict_types = 1);
/**
* Exception thrown in case the main entity of a page (e.g. an object, an institution etc.)
* are not set public.
*/
class MDPageNotInAggregatedException extends Exception {
/**
* Error message.
*
* @return string
*/
public function errorMessage() {
//error message
$errorMsg = 'There is no entity to be shown here (id: <b>' . $this->getMessage() . '</b>).';
return $errorMsg;
}
}

View File

@ -0,0 +1,22 @@
<?PHP
declare(strict_types = 1);
/**
* Exception thrown in case the main entity of a page (e.g. an object, an institution etc.)
* are not set public.
*/
class MDmainEntityNotPublicException extends Exception {
/**
* Error message.
*
* @return string
*/
public function errorMessage() {
//error message
$errorMsg = 'There is no entity to be shown here (id: <b>' . $this->getMessage() . '</b>).';
return $errorMsg;
}
}

View File

@ -0,0 +1,21 @@
<?PHP
declare(strict_types = 1);
/**
* Custom exception class for missing page parameters.
*/
class MDpageParameterMissingException extends Exception {
/**
* Error message.
*
* @return string
*/
public function errorMessage() {
//error message
$errorMsg = 'Parameter: <b>' . $this->getMessage() . '</b> is required but missing.';
return $errorMsg;
}
}

View File

@ -0,0 +1,21 @@
<?PHP
declare(strict_types = 1);
/**
* Custom exception class for invalid page parameters.
*/
class MDpageParameterNotNumericException extends Exception {
/**
* Error message.
*
* @return string
*/
public function errorMessage() {
//error message
$errorMsg = 'Parameter: <b>' . $this->getMessage() . '</b> is not a valid, numeric values.';
return $errorMsg;
}
}