Add MDExpectedException as a parent class for MDAccessDeniedException,
make it expected
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 MDExpectedException | ||||||
|             || $exception instanceof MDMysqliExpectedError |             || $exception instanceof MDMysqliExpectedError | ||||||
|         ) { |         ) { | ||||||
|             return self::MD_ERROR_KNOWN; |             return self::MD_ERROR_KNOWN; | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ declare(strict_types = 1); | |||||||
| /** | /** | ||||||
|  * Custom exception class for invalid page parameters. |  * Custom exception class for invalid page parameters. | ||||||
|  */ |  */ | ||||||
| class MDAccessDeniedException extends Exception { | class MDAccessDeniedException extends MDExpectedException { | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * Error message. |      * Error message. | ||||||
|   | |||||||
							
								
								
									
										21
									
								
								exceptions/generic/MDExpectedException.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								exceptions/generic/MDExpectedException.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | |||||||
|  | <?PHP | ||||||
|  | declare(strict_types = 1); | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * Custom exception class for invalid page parameters. | ||||||
|  |  */ | ||||||
|  | class MDExpectedException 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; | ||||||
|  |  | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user