Add two new exceptions for invalid list values
This commit is contained in:
parent
ac9b12618d
commit
a2b0325f5b
26
exceptions/updates/MDInvalidColor.php
Normal file
26
exceptions/updates/MDInvalidColor.php
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<?PHP
|
||||||
|
/**
|
||||||
|
* This file contains an exception class for usage of unaccepted color.
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
|
*/
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom exception class to be raised when trying to use a color that is not
|
||||||
|
* accepted by museum-digital.
|
||||||
|
*/
|
||||||
|
final class MDInvalidColor extends MDgenericInvalidInputsException {
|
||||||
|
/**
|
||||||
|
* Error message.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function errorMessage() {
|
||||||
|
//error message
|
||||||
|
return 'The following color is not available: ' . $this->getMessage();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
26
exceptions/updates/MDInvalidObjectForm.php
Normal file
26
exceptions/updates/MDInvalidObjectForm.php
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<?PHP
|
||||||
|
/**
|
||||||
|
* This file contains an exception class for usage of unaccepted object form.
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
|
*/
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom exception class to be raised when trying to use an object form that is not
|
||||||
|
* accepted by museum-digital.
|
||||||
|
*/
|
||||||
|
final class MDInvalidObjectForm extends MDgenericInvalidInputsException {
|
||||||
|
/**
|
||||||
|
* Error message.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function errorMessage() {
|
||||||
|
//error message
|
||||||
|
return 'The following object form is not available: ' . $this->getMessage();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user