Add exceptions from frontend
This commit is contained in:
21
exceptions/generic/MDAccessDeniedException.php
Normal file
21
exceptions/generic/MDAccessDeniedException.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?PHP
|
||||
declare(strict_types = 1);
|
||||
|
||||
/**
|
||||
* Custom exception class for invalid page parameters.
|
||||
*/
|
||||
class MDAccessDeniedException 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;
|
||||
|
||||
}
|
||||
|
||||
}
|
21
exceptions/generic/MDConfigCannotBeLoadedException.php
Normal file
21
exceptions/generic/MDConfigCannotBeLoadedException.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?PHP
|
||||
declare(strict_types = 1);
|
||||
|
||||
/**
|
||||
* Custom exception class for errors loading configuration information.
|
||||
*/
|
||||
class MDConfigCannotBeLoadedException extends Exception {
|
||||
|
||||
/**
|
||||
* Error message.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function errorMessage() {
|
||||
//error message
|
||||
$errorMsg = 'Could not connect to databse. Please try again later.';
|
||||
return $errorMsg;
|
||||
|
||||
}
|
||||
|
||||
}
|
22
exceptions/generic/MDmainEntityNotExistentException.php
Normal file
22
exceptions/generic/MDmainEntityNotExistentException.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?PHP
|
||||
declare(strict_types = 1);
|
||||
|
||||
/**
|
||||
* Custom exception class for invalid page parameters, which must be values of a
|
||||
* preset list of allowed values.
|
||||
*/
|
||||
class MDmainEntityNotExistentException extends Exception {
|
||||
|
||||
/**
|
||||
* Error message.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function errorMessage() {
|
||||
//error message
|
||||
$errorMsg = 'Could not connect to databse. Please try again later.';
|
||||
return $errorMsg;
|
||||
|
||||
}
|
||||
|
||||
}
|
22
exceptions/generic/MDpageParameterNotFromListException.php
Normal file
22
exceptions/generic/MDpageParameterNotFromListException.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?PHP
|
||||
declare(strict_types = 1);
|
||||
|
||||
/**
|
||||
* Custom exception class for invalid page parameters, which must be values of a
|
||||
* preset list of allowed values.
|
||||
*/
|
||||
class MDpageParameterNotFromListException extends Exception {
|
||||
|
||||
/**
|
||||
* Error message.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function errorMessage() {
|
||||
//error message
|
||||
$errorMsg = 'Invalid parameter: <b>' . $this->getMessage() . '</b>.';
|
||||
return $errorMsg;
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user