Add exceptions for invalid weight and length units
This commit is contained in:
		| @@ -38,6 +38,7 @@ class MDErrorReporter { | |||||||
|             || $exception instanceof MDPageNotInAggregatedException |             || $exception instanceof MDPageNotInAggregatedException | ||||||
|             || $exception instanceof MDWrongFileType |             || $exception instanceof MDWrongFileType | ||||||
|             || $exception instanceof MDTooManyFilesUploadException |             || $exception instanceof MDTooManyFilesUploadException | ||||||
|  |             || $exception instanceof MDgenericInvalidInputsException | ||||||
|             || $exception instanceof MDExpectedException |             || $exception instanceof MDExpectedException | ||||||
|             || $exception instanceof MDMysqliExpectedError |             || $exception instanceof MDMysqliExpectedError | ||||||
|         ) { |         ) { | ||||||
|   | |||||||
							
								
								
									
										29
									
								
								exceptions/updates/MDInvalidLengthUnit.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								exceptions/updates/MDInvalidLengthUnit.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | <?PHP | ||||||
|  | /** | ||||||
|  |  * This file contains an exception class for usage of unaccepted length units. | ||||||
|  |  * | ||||||
|  |  * @file | ||||||
|  |  * | ||||||
|  |  * @author Joshua Ramon Enslin <joshua@museum-digital.de> | ||||||
|  |  */ | ||||||
|  | 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; | ||||||
|  |  | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -12,7 +12,7 @@ declare(strict_types = 1); | |||||||
|  * Custom exception class to be raised when trying to use a license that is not |  * Custom exception class to be raised when trying to use a license that is not | ||||||
|  * accepted by museum-digital. |  * accepted by museum-digital. | ||||||
|  */ |  */ | ||||||
| class MDInvalidLicense extends Exception { | class MDInvalidLicense extends MDgenericInvalidInputsException { | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * Error message. |      * Error message. | ||||||
|   | |||||||
							
								
								
									
										29
									
								
								exceptions/updates/MDInvalidWeightUnit.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								exceptions/updates/MDInvalidWeightUnit.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | <?PHP | ||||||
|  | /** | ||||||
|  |  * This file contains an exception class for usage of unaccepted weight units. | ||||||
|  |  * | ||||||
|  |  * @file | ||||||
|  |  * | ||||||
|  |  * @author Joshua Ramon Enslin <joshua@museum-digital.de> | ||||||
|  |  */ | ||||||
|  | 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; | ||||||
|  |  | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user