diff --git a/MDErrorReporter.php b/MDErrorReporter.php index a63092e..b080cde 100644 --- a/MDErrorReporter.php +++ b/MDErrorReporter.php @@ -38,6 +38,7 @@ class MDErrorReporter { || $exception instanceof MDPageNotInAggregatedException || $exception instanceof MDWrongFileType || $exception instanceof MDTooManyFilesUploadException + || $exception instanceof MDgenericInvalidInputsException || $exception instanceof MDExpectedException || $exception instanceof MDMysqliExpectedError ) { diff --git a/exceptions/updates/MDInvalidLengthUnit.php b/exceptions/updates/MDInvalidLengthUnit.php new file mode 100644 index 0000000..037d3f1 --- /dev/null +++ b/exceptions/updates/MDInvalidLengthUnit.php @@ -0,0 +1,29 @@ + + */ +declare(strict_types = 1); + +/** + * Custom exception class to be raised when trying to use a length unit that is not + * accepted by museum-digital. + */ +class MDInvalidLengthUnit extends MDgenericInvalidInputsException { + + /** + * Error message. + * + * @return string + */ + public function errorMessage() { + //error message + $errorMsg = 'The following length unit is not available: ' . $this->getMessage(); + return $errorMsg; + + } + +} diff --git a/exceptions/updates/MDInvalidLicense.php b/exceptions/updates/MDInvalidLicense.php index 17a5786..8b03d55 100644 --- a/exceptions/updates/MDInvalidLicense.php +++ b/exceptions/updates/MDInvalidLicense.php @@ -12,7 +12,7 @@ declare(strict_types = 1); * Custom exception class to be raised when trying to use a license that is not * accepted by museum-digital. */ -class MDInvalidLicense extends Exception { +class MDInvalidLicense extends MDgenericInvalidInputsException { /** * Error message. diff --git a/exceptions/updates/MDInvalidWeightUnit.php b/exceptions/updates/MDInvalidWeightUnit.php new file mode 100644 index 0000000..584d63b --- /dev/null +++ b/exceptions/updates/MDInvalidWeightUnit.php @@ -0,0 +1,29 @@ + + */ +declare(strict_types = 1); + +/** + * Custom exception class to be raised when trying to use a weight unit that is not + * accepted by museum-digital. + */ +class MDInvalidWeightUnit extends MDgenericInvalidInputsException { + + /** + * Error message. + * + * @return string + */ + public function errorMessage() { + //error message + $errorMsg = 'The following weight unit is not available: ' . $this->getMessage(); + return $errorMsg; + + } + +}