Add exceptions MDFileDoesNotExist MDFileIsNotReadable

This commit is contained in:
Joshua Ramon Enslin 2020-07-26 05:41:06 +02:00 committed by Stefan Rohde-Enslin
parent 1f85db155f
commit 106312f6e3
3 changed files with 57 additions and 1 deletions

View File

@ -111,7 +111,7 @@ class MDErrorReporter {
/** /**
* Gets additional debugging information, e.g. RAM usage. * Gets additional debugging information, e.g. RAM usage.
* *
* @return array<string> * @return array<string|array<string>>
*/ */
final public function getAdditionalDebuggingInfo():array { final public function getAdditionalDebuggingInfo():array {

View 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;
}
}

View 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;
}
}