From a2b0325f5b1612cca732b09da16d4941231b320f Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Mon, 23 Jan 2023 22:15:25 +0100 Subject: [PATCH] Add two new exceptions for invalid list values --- exceptions/updates/MDInvalidColor.php | 26 ++++++++++++++++++++++ exceptions/updates/MDInvalidObjectForm.php | 26 ++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 exceptions/updates/MDInvalidColor.php create mode 100644 exceptions/updates/MDInvalidObjectForm.php diff --git a/exceptions/updates/MDInvalidColor.php b/exceptions/updates/MDInvalidColor.php new file mode 100644 index 0000000..2254705 --- /dev/null +++ b/exceptions/updates/MDInvalidColor.php @@ -0,0 +1,26 @@ + + */ +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(); + + } +} diff --git a/exceptions/updates/MDInvalidObjectForm.php b/exceptions/updates/MDInvalidObjectForm.php new file mode 100644 index 0000000..d8a7a33 --- /dev/null +++ b/exceptions/updates/MDInvalidObjectForm.php @@ -0,0 +1,26 @@ + + */ +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(); + + } +}