Add exceptions MDFileDoesNotExist MDFileIsNotReadable
This commit is contained in:
parent
1f85db155f
commit
106312f6e3
|
@ -111,7 +111,7 @@ class MDErrorReporter {
|
|||
/**
|
||||
* Gets additional debugging information, e.g. RAM usage.
|
||||
*
|
||||
* @return array<string>
|
||||
* @return array<string|array<string>>
|
||||
*/
|
||||
final public function getAdditionalDebuggingInfo():array {
|
||||
|
||||
|
|
28
exceptions/generic/MDFileDoesNotExist.php
Normal file
28
exceptions/generic/MDFileDoesNotExist.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?PHP
|
||||
/**
|
||||
* This file contains an exception class for trying to enter non-existent files.
|
||||
*
|
||||
* @file
|
||||
*
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
*/
|
||||
declare(strict_types = 1);
|
||||
|
||||
/**
|
||||
* Custom exception class for non-existing files.
|
||||
*/
|
||||
class MDFileDoesNotExist extends Exception {
|
||||
|
||||
/**
|
||||
* Error message.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function errorMessage() {
|
||||
//error message
|
||||
$errorMsg = 'This file does not exist: ' . $this->getMessage();
|
||||
return $errorMsg;
|
||||
|
||||
}
|
||||
|
||||
}
|
28
exceptions/generic/MDFileIsNotReadable.php
Normal file
28
exceptions/generic/MDFileIsNotReadable.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?PHP
|
||||
/**
|
||||
* This file contains an exception class for trying to enter non-existent files.
|
||||
*
|
||||
* @file
|
||||
*
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
*/
|
||||
declare(strict_types = 1);
|
||||
|
||||
/**
|
||||
* Custom exception class for non-existing files.
|
||||
*/
|
||||
class MDFileIsNotReadable extends Exception {
|
||||
|
||||
/**
|
||||
* Error message.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function errorMessage() {
|
||||
//error message
|
||||
$errorMsg = 'This file does not exist: ' . $this->getMessage();
|
||||
return $errorMsg;
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user